Whenever you have composition functions, you must put the whole function in instead of x.
For example, (f o g) (x) means f of g(x) so wherever you see "x" in the f(x) function, you put in the WHOLE g(x) function. As follows,
(f o g)(x)=2(x-1)^2+1
Then you simplify,
=2(x^2-2x+1)+1
=2x^2-4x+2+1
=2x^2-4x+3
Now, we do the same for g of f(x)
(g o f)(x)=2x^2+1-1
=2x^2
Now, we subtract our both results,
(2x^2-4x+3)-(2x^2)
=-4x+3