i saw but i don't understand what they're doing
why do they let f(x)-g(x)=-p(x)?
The curves y = f(x) and y = g(x) meet only when f(x) = g(x), or f(x) - g(x) = 0.
We know this equation is a degree four polynomial as the degree of f(x) is 4 and the degree of g(x) is 2.
We also know that this equation has only two solutions (as two points of contact) and in each case the curves touch without crossing, meaning that the equation f(x) - g(x) = 0 must have two double roots.
Hence, it can be expressed in the form from part (i)
...except that P(x) in part (i) is monic whereas f(x) - g(x) has a leading coefficient of -1, and so we have f(x) - g(x) = -P(x) = 0.