Answer
$f(x)=-3(x+2)^2+4$.
Work Step by Step
The given maximum value is $=4$ at $x=-2$.
The vertex is $(h,k)=(-2,4)$
For the maximum value $a$ must be less than zero.
Take the given function $g(x)=-3x^2$.
The equation of the parabola that has the same shape is
$\Rightarrow f(x)=-3(x-h)^2+k$
Substitute the values of $h$ and $k$.
$\Rightarrow f(x)=-3(x-(-2))^2+4$.
Simplify.
$\Rightarrow f(x)=-3(x+2)^2+4$.