Let Z denote the set of integers. We define
SP={t∣t∈Z and P(t)=t}andSQ={t∣t∈Z and Q(t)=t}.
Clearly, SP is a subset of SQ. Also note that there are at most n elements in SP. This is so because that t∈SP if and only if t is a root of polynomial P(x)−x=0 of degree n, which has at most n roots. If SQ=SP, we have nothing to prove. We assume that SP is a proper subset of SQ, and that t∈SQ but t∈/SP.
Consider the sequence {ti}i=0∞ with t0=t, ti+1=P(ti) for every nonnegative integer i. Since t∈SQ, tk=Q(t0)=Q(t)=t=t0.
Since the polynomial a−b divides the polynomial am−bm (where m is a nonnegative integer), it is not difficult to see that the polynomial a−b divides the polynomial P(a)−P(b), where P(x) is a polynomial with integer coefficients. In our current problem, then, we can conclude that the integer sequence {ti}i=0∞ satisfies the following sequence of divisibility relations
(ti+1−ti)∣(P(ti+1)−P(ti))=ti+2−ti+1
for every nonnegative integer i. Since tk+1−tk=t1−t0=P(t)−t=0, each term in the chain of differences
t1−t0,t2−t1,…,tk−tk−1,tk+1−tk
is a nonzero divisor of the next one, and since tk+1−tk=t1−t0, all these differences have equal absolute values. Let ti=max{t0,t1,…,tk}. Then ti−1−ti=−(ti−ti+1), or ti−1=ti+1. It is then not difficult to see that ti+2=ti for every i; that is,
t1=P(t0)andt0=P(t1)orP(P(t0))=t0.
Therefore,
SQ={t∣t∈Z and P(P(t))=t}.
Without loss of generality, we may assume that t0<t1. If s0 is another element in SQ, let s1=P(s0). (It is possible that s0∈SP; that is, s1=s0.) We further assume without loss of generality that s0<s1 and t0<s0; that is, t0<s0≤s1 and t0<t1. Note that s1−t0 divides P(s1)−P(t0)=s0−t1. We must have t0<s0<s1<t1. Note that s0−t1 also divides P(s0)−P(t1)=s1−t0, it follows that s0−t1=−(s1−t0); that is,
t0+t1=s0+s1=s0+P(s0).
In other words, s0 is a root of the polynomial P(x)+x=t0+t1. Since P(x)+x has degree n, there are at most n (integer) roots (including t0) of P(x)+x. Hence there are at most n elements in SQ, completing our proof.