You have the following expression for an exponential function:

By using the given points (-2,4) and (-1,8), you can find the values of coeffcients a and b, as follow:
The first pair (-2,4) means that for x=-2, f(x)=4:

and the second pair (-1,8) means that for x=-1, f(x)=8:

If you divide the second equation between the first equation, you can cancel out coefficient a and solve for b:

where you have used properties of exponents.
Now, if you replace the previous value of b into any of the equations for the pairs, for instance, into the first equation, you obtain for a:

Hence, the form of the function f(x) is:
