So I’m doing more of a math problem now, so I’m not sure if this is the right place to ask but I thought perhaps somebody could help.

So the problem goes as follows:

Prove that for a polynomial P(x), such that its coefficients are all integers, if there exist at least 4 distinct values of x, such that P(x)=1, there can be no value k for which P(k)=-1.

The proof I found states that if there are some 4 x_i for which this claim holds, namely x_1, x_2, x_3, and x_4 and P(x_i)=1, then for some k we derive:

P(k)-1=(k-x_1)(k-x_2)(k-x_3)(k-x_4)Q(k), such that Q(k) is a polynomial with integer coefficients.

I really don’t understand a thing about this proof. How is this even derived? I’d appreciate your help in deciphering this proof. Thanks.