If $f: \mathbb R \to \mathbb R$ and $f$ is continuous and for every real value of $x : f(f(x))=x$ , prove that there is a $c$ where $f(c)=c$ If $f: \mathbb R \to \mathbb R$  and $f$ is continuous and for every real value of $x : f(f(x))=x$ , prove that there is a $c$ where $f(c)=c$.
I know how to prove that a continuous function like $f: [a,b] \to [a,b]$ has a fixed point, but I don't know how to distinguish intervals in this question.
 A: Let $g(x)=f(x)-x$, suppose that it doesn't have any root. Then, by continuity of $g$, either it is always positive, or always negative. Suppose that it is always positive, then $f(x)>x\forall x\in\Bbb R$. Hence, $f(f(x))>f(x)>x$, which is a contradiction. The case when $g(x)$ is always negative is similar.
A: if we always had $f(x) > x,$ we would then have $f(f(x)) > f(x) > x,$ so $f(f(x)) > x$ always, finally $f(f(x)) \neq x.$ That's a contradiction of hypotheses, so we must sometimes have $f(x) \leq x.$
Similar for $f(x) < x$ always...
A: Clearly $A=(a,f(a))$ and $B=(f(a),a)$ lies on a graph of function $f$. 
Then if $f(a)=a$ we are done else $f(a)\ne a$ so $A,B$ are on different sides of a line $y=x$, so the graph must cut $y=x$ (since $f$ is contiuous) and we are done.
A: 
I know how to prove that a continuous function like f:[a,b]→[a,b] has a fixed point, but I don't know how to distinguish intervals in this question.

Then Make an interval.
Let $x_0$ be any point.  If $f(x_0) =x_0$ we can let $c = x_0$ and we are done.
If $x_0 < f(x_0)$ let $a = x_0$ and $b = f(x_0)$.  In this case you have i) $a < b$ and ii) $f(a) = b$.  And iii) $f(b) = f(f(a)) = a$.
If $x_0 > f(x_0)$ then let $a=f(x_0)$ and let $b =x_0$.  Again in this case you have i)$a < b$ and ii) $f(a) = f(f(b))=b$ and ii) $f(b) = a$.
and thus you know that $f$ is continuous on $[a,b]$ and that $f(a) = b$ and $f(b)  = a$ and .... now go to town.
....
Let $g(x)=f(x) -x$ which is continuous.  $g(a) = f(a) - a = b-a >0$  and $g(b) = f(b) - b=a-b < 0$ so there is a $c:  a < c < b$ so that $g(c) = 0$ so $f(c) - c = 0$ and $f(c) = c$.
