Answer: (p, q) = (3, 2)
Step-by-step explanation:
So we get that g(f(x)) = p(1-x)^2 + q = p(x^2 - 2x + 1)+q = px^2 - 2px + p+q.
Matching coefficients, we get that p=3, -2p=-6, and p+q=5.
It follows that p=3 and q=2.