If a function over reals is given by $$f(x) = \sum_{n=0}^\infty a_n x^n$$ and satisfies $$f(f(x))=f(x),$$ does this imply that $f(x) = x$ and $f(x) = c$ are only valid choices for $f(x)$?
It seems obvious that if can't be anything else, but I am having trouble with devising a rigorous proof.
Hint
$$f(f(x))=f(x)\implies f'(f(x))f'(x)=f'(x).$$