The easiest way is to calculate g(-2) first
g(-2) = 5*(-2) + 7 = -10 + 7 = -3.
and then substitute this value g(-2) = -3 into the formula for f(x).
So, (fog) (-2) = f(-3) = 3*(-3)^2 + 2*(-3) - 1 = 27 - 6 - 1 = 20 is your answer.
Solved.
---------------
The meaning of this operation, (fog), which is called "the composition of functions g and f", is that
the output of "g" becomes the input for "f".