Given that $f’(X) \leq 2$ and $f(-3) = 7$,
As maximum slope is positive and we need value of $f(x)$ at $3$ which is on right side of $-3$, we can assume $f(x)$ as a straight line with slope $2$. It will give us the correct result.
Let $f(x) = 2x + b,$
$f(-3) = -6 + b = 7 \Rightarrow b = 13$
$f(x) = 2x + 13$
$f(3)_{\max} = 6 + 13 = 19.$
Correct method would be using Mean Value Theorem. Above method will work only if you can analyze the cases correctly and can assume the $f(x)$ without any loss of accuracy, otherwise you are very prone to commit a mistake that way.
Using Mean Value Theorem:
$f’(c) = \frac{f(b) – f(a)}{b -a }$
$\Rightarrow f’(c) = \frac{f(3) – f(-3)}{3 -(-3)} = \frac{f(3) – 7}{6} $
$\Rightarrow f(3) = 6f’(c) +7 $
As $f’(c)\leq 2$,
$\Rightarrow f(3) \leq 6*2 +7 = 19.$