Answer
$f(x)=-\frac{1}{2}x-1$
Work Step by Step
We can rewrite $f(-2)=0$ as $(-2,0)$ and $f(6)=-4$ as $(6,-4)$.
The slope of the line that passes through $(-2,0)$ and $(6,-4)$ is
$m=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}=\frac{-4-0}{6-(-2)}=-\frac{1}{2}$
Equation of the line is
$y-y_{1}=m(x-x_{1})$
$\implies y-0=-\frac{1}{2}(x-(-2))$
$\implies y=-\frac{1}{2}x-1$
A function is $f(x)=-\frac{1}{2}x-1$.