I got this problem:
Find examples of continuous functions $f:[0,1]\to[0,1]$ that satisfy $\forall x\in[0,1], f(f(x))=f(x)$ other than $f(x)=x$.
I proved that $f([0,1])=\{x\in[0,1]|f(x)=x\}$, But I couldn't find an example of a function other than $f(x)=x$ that satisfies the conditions.
Thanks on any examples.
The condition $f(f(x)) = f(x)$ is equivalent to $f(y)= y$ for all $y \in $ image of $f$.
Take an $f$ that is not surjective: $f(x) = x$ for $x\le 1/2$ and $f(x) = 1/2$ for $x\ge 1/2$.