We have p(x)−p(y)=(x3+14x2−2x+1)−(y3+14y2−2y+1)=(x−y)(x2+xy+y2+14x+14y−2). Since 101 is prime, p(x)≡p(y)(mod101)⇔x≡y(mod101) or x2+xy+y2+14x+14y−2≡0(mod101).
Completing squares, we have
x2+xy+y2+14x+14y−2≡0(mod101)⇔(2x+y+14)2+3y2+28y−2≡0(mod101)⇔(2x+y+14)2≡−3(y−29)2(mod101)(∗)
By the quadratic reciprocity law, (101−3)⋅(−3101)=(−1)2101−1⋅2−3−1=1⇔(101−3)=(32)=−1, so −3 is not a quadratic residue modulo 101. Thus
(∗)⇔2x+y+14≡y−29≡0(mod101)⇔x≡y≡29(mod101)
Thus p(x)≡p(y)(mod101)⇔x≡y(mod101), which means that p(x) admits an inverse function.
To finish the problem, fix x and consider x,p(x),p(2)(x),…(mod101). Since there are infinite numbers and 101 remainders, there are m and n such that m>n and p(m)(x)=p(n)(x)(mod101)⇔p(m−n)≡x(mod101). So for each k(mod101) there is a positive integer nk such that p(nk)(k)≡k(mod101). Choose N=lcm(n1,n2,…,n101) and we are done.