For the interval $\left ( -2,3 \right )$, it is pretty clear that $f\left ( x \right )=4$. So option C is eliminated.
Using the two-point form of straight line concept, i.e. equation of a straight line passing through two given points is :
$y-y_{1}=\frac{y_{2}-y_{1}}{x_{2}-x_{1}}\left ( x-x_{1} \right )$
So, for the interval $\left [ -\infty ,2 \right ]$, the equation of the line would be $y-4=\left ( -1 \right )\left ( x+2 \right )$ $\Rightarrow$ $y=2-x$
$\therefore$ Option D is the correct answer.