g(x) = x^2 - 3
f(x) = x^3+7x^2-x
Start with the g(x) function. Replace every x with f(x)
g(x) = x^2 - 3
g(f(x)) = ( f(x) )^2 - 3
Then replace the f(x) on the right side with x^3+7x^2-x
g(f(x)) = (x^3+7x^2-x)^2 - 3
The highest term inside the parenthesis is x^3. Squaring this leads to (x^3)^2 = x^(3*2) = x^6
So the highest exponent found in g(f(x)) is 6, meaning the degree of is 6