As stated in the title; Let $f: \mathbb R \to \mathbb R $ be a continuous function satisfying $f(f(x))$ = $f(x)$ then
(a) $f$ must be constant
(b) $f(x) = x$ for all $x$ in range of $f$
(c) $f$ must be a non constant polynomial
(d) There is no such function
By randomly trying different functions I discovered that $f(x) = x$ and $f(x) = 1-x$ satisfy given property . So using this option (c) seems to be correct.
But , My question is that How can I make sure that these are the only functions that hold this property ? and if there are any other function (other than these two) then how should I find them .
Thank you
The answer should be $b$. Suppose not. That means there exists $f$ and there exists $y_0$ such that we have some $x_0$ with $f(x_0)=y_0$ and we have $f(y_0)\neq y_0$.
Then, $f(x_0)=y_0$, but $f(f(x_0))=f(y_0)\neq y_0$, which contradicts the assumtion that $f(f(x))=f(x)$ for all $x$.