posted by Anubhav .
Let f(x) be a polynomial such that
It is clear that f(x) is linear. If it were, say, quadratic,
f(x) = ax^2+bx+c with a≠0
f(f) = af^2+bf+c
= a(ax^2+bx+c)^2 + b(ax^2+bx+c) + c
is a 4th-degree polynomial.
xf(x)+x^2 = x(ax^2+bx+c) + x^2
is a 3rd-degree polynomial. That would mean a=0.
f(x) = ax+b
f(f) = af+b = a(ax+b)+b = a^2x+(ab+b)
xf(x)+x^2 = x(ax+b)+x^2 = (a+1)x^2 + bx
So, a+1=0, and a = -1
That makes b=1, and so
f(x) = 1-x
f(f(x)) = 1-f = 1-(1-x) = x
xf(x)+x^2 = x(1-x)+x^2 = x