$\exists x_0$ such that $f(f(x_0))=x_0$ prove that $f$ has a fixed point 
Let $f:\mathbb R\to \mathbb R$ be coninuous. Suppose there exists $x_0$ such that $f(f(x_0))=x_0$. Prove that $f$ has a fixed point or in other words: $\exists c\in\mathbb R: f(c)=c$ .

Suppose $f(x_0)\neq x_0$ and there's some $x_1$ such that $f(x_1)=x_0$.
Then: $f(f(x_1))=f(x_0)\neq x_0$ and, $f(f(x_0))=f(x_2)=x_0$ but $f(x_1)=x_0$ and since the function is continuous there can't be $x_1\neq x_2: f(x_1)=f(x_2)$ so there's a contradiction. 
 A: It seems to me that you're trying to use a proof by contradiction to prove that $f(x_0)=x_0$.  However, this isn't necessarily true, as the function $f(x)=-x$ is such that $f(f(x))=x$ for every $x$, but that does not mean that every $x$ is a fixed point.  (Of course, there is a fixed point, 0)
I can't tell whether you're assuming $x_1$ exists or if you have some other reason for assuming its existence, so I would clear that up.  Define $x_2$, and finally, continuity is not the same as injectivity: I don't see why $x_1\neq x_2$ implies that $f(x_1)\neq f(x_2)$.  
A: The proof is wrong:

since the function is continuous there can't be $x_1\neq x_2: f(x_1)=f(x_2)$

That's not at all the definition of continuous function, but the definition of injective function.
If $f(x_0)=x_0$, the statement is proved. If not, suppose that $f(x_0)=x_1>x_0$. Then, $f(x_1)=x_0<x_1$.
Now, define $g(x)=f(x)-x$ (this is an usual trick to prove the existence of fixed points, provided that you can make the substraction).
Then $g(x_0)=x_1-x_0>0$ and $g(x_1)=x_0-x_1<0$. By Bolzano's Theorem, there exists $c\in(x_0,x_1)$ such that $g(c)=0$, that is, $f(c)=c$.
The proof for the case $x_1<x_0$ is analogous.
