To find g (f(x)) you should substitute "4x^2+x+1" to "x" of g(x) function. You'll havew:
[tex]g(f(x))= (4x^2+x+1)^2-2=\\ \\ =(4x^2+x)^2 +2 \cdot (4x^2+x) \cdot 1 +1^2-2= \\ \\ = 16x^4+8x^3+x^2+8x^2+2x+1-2= \\ \\ = 16x^4+8x^3+9x^2+2x-1[/tex]
To count (4x^2+x+1)^2 Just assume ( [4x^2+x] + 1)^2 and use the (a+b)^2=a^2+2ab+b^2 formula, where a=4x^2+x and b=1