It is given in the question that
[tex]h(x) = (fog)(x) = x^2 -81[/tex]
And [tex]x^2 -81[/tex]
can also be written as
[tex](x^2 -40) -41[/tex]
Therefore,
[tex](fog)(x) = (x^2 -40)-41[/tex]
[tex]f(g(x)) = (x^2 -40)-41[/tex]
That gives,
[tex]g(x) = x^2 -40, f(x) = x-41[/tex]