Technically speaking, f(x) = x^2 - 4 does not have an inverse, because any attempt to invert it yields two equations as follows:
Substitute f^-1(x) for every x in f(x)
f(f^-1(x)) = (f^-1(x))^2 - 4
The property f(f^-1(x)) = x makes the left side become x:
x = (f^-1(x))^2 - 4
(f^-1(x))^2 = x + 4
f^-1(x) = {(sqrt(x + 4)),(-sqrt(x + 4)):}
At this point, one should stop and declare the problem unsolvable but let's proceed.
Use the property f^-1(f(g(x))) =g(x)
f^-1(f(g(x))) ={(sqrt(4x^2 - 8x + 4)),(-sqrt(4x^2 - 8x + 4)):}
Simplify the left side and remove a factor of 2 from the right:
g(x) ={(2sqrt(x^2 - 2x + 1)),(-2sqrt(x^2 - 2x + 1)):}
Please observe the what is under the radical is a perfect square, x^2 - 2x + 1 = (x - 1)^2:
g(x) ={(2(x - 1)),(-2(x -1)):}
g(x) ={(2x - 2),(-2x + 2):}
check:
f(g(x)) = {((2x-2)^2 - 4),((-2x + 2)^2 - 4):}
f(g(x)) = {(4x^2- 8x + 4 - 4),(4x^2 - 8x + 4 - 4):}
f(g(x)) = {(4x^2- 8x),(4x^2 - 8x):}
f(g(x)) = 4x^2- 8x
Both cases reduce to a single equation that checks.
I think that the desired answer is g(x) = 2x - 2 but I have no good reason to discard the negative case, g(x) = -2x + 2