*Answer: P(x)=ax−1, a=0.*
First note that P cannot be a constant. Now let n=1 and P(x)=ax+b. Then
{P(P(x)+x)=a(ax+b+x)+b=(a2+a)x+ab+b,P(P(x))+P(x)+1=a(ax+b)+b+ax+b+1=(a2+a)x+ab+2b+1.
Hence
P(P(x)+x)=P(P(x))+P(x)+1⟺b=−1.
Thus all the polynomials of the form P(x)=ax−1, a=0, satisfy the condition of the problem.
Finally, suppose n≥2. Let an=0 denote the leading coefficient of P(x). Then the leading coefficient of P(P(x)+x) is ann+1 and the leading coefficient of P(P(x))+P(x)+1 is (ann+1+ann). Since P(P(x)+x)=P(P(x))+P(x)+1 we get that ann+1=ann+1+ann. Hence an=0, which is a contradiction.