(f o g)(x) = f( g(x) )
Since g(x) = -x + 1, we can substitute -x + 1 in for g(x)
(f o g)(x) = f( -x + 1 )
And f(x) = x2 + 2, so to find f(-x + 1), plug -x + 1 into
the function by replacing every instance of x with -x + 1
(f o g)(x) = (-x + 1)2 + 2
Expand the squared term by multiplying it out.
(f o g)(x) = (-x + 1)(-x + 1) + 2
(f o g)(x) = x2 - 2x + 1 + 2
(f o g)(x) = x2 - 2x + 3