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