$f$ is continuous function from $ [0,1]$ to itself and f(0)=0, f(1)=1 and $f(f(x))=x$ then show that $f(x)=x$ on$[0,1]$ If $f$ is continuous from $ [0,1]$ to itself and $f(0)=0$, $f(1)=1$ and $f(f(x))=x$ then show that $f(x)=x$ for every $ x $ in the domain of function.
I'd like to prove this statement, my idea goes like below:
Suppose that the converse of the statement holds. then without loss of generality, assume that there exists some $c$ in $[0,1]$ such that $d=f(c)>c$. By symmetry, $f(d)=f(f(c))<f(c)=d$. And $f$ is bijective because $f$ has an inverse function in this domain. So $f$ should be strictly increasing function.
But on $[c,d]$, $f$ is decreasing.
This is a contradiction.
So it should be that $f(x)=x$ on $[0,1]$.
Is this argument right? And I'd like to know another argument which prove this statement. Thank you for your answer in advance :)
 A: It is definitely not o.k. If $f\ne{\rm id}$ then there is a $c$ with $f(c)=d\ne c$ and $f(d)=c$, and one of $c$ or $d$ is larger, say $d$. But this does not imply that $f$ is decreasing on $[c,d]$. Furthermore you seem to make use of the fact that a continuous bijective $f:\>[0,1]\to[0,1]$ has to be monotone. This is indeed true, and has been proven here many times, but it is not obvious.
Instead produce a clearcut inconsistent situation: If $f\ne{\rm id}$ then there is a $c>0$ with $f(c)=d>c$, and $f(d)=c$, by assumption. On the other hand $f(0)=0<c<d=f(c)$. Therefore there is a $d'\in\>]0,c[\>$ with $f(d')=c$, by the intermediate value theorem. We then would have $d'=f(c)=d$, contradicting $d'<c<d$.
A: Take $y \in [0, 1]$. Then there is some $x \in [0, 1]$ such that $f(x)=y$. Define $z_n:=f^n(x)$, where $f^1:=f$ and $f^{n+1}:=f \circ f^n$. Then $z_{2n}=x$ and $z_{2n+1}=y$. Since $f$ is increasing, $(z_n)$ is monotone(and bounded), hence convergent. So $x=y=f(x)$.
A: Partial solution(Not a solid proof, rather a thought):
$f(f(x))=x$ implies that $f$ is the inverse of itself i.e. its symmetrical about $y=x$.
And as it has a inverse it must be bijective i.e. one-one and onto.
As $f(0)=0$ and $f(1)=1$ and it's continuous on $[0,1]$.
$y=x$, which is your proof
