Substitute h(n) for the argument of g(n).
... g(h(n)) = g(n^2-2) = 2(n^2-2) +2
... = 2n^2 -4 +2 . . . . . . . eliminate parentheses
... g(h(n)) = 2n^2 -2