$f(g(x))=g(f(x))$ implies $f(c)=g(c)$ for some $c$ Let $f$ and $g$ be continuous functions and map from $[0,1]$ to $[0,1]$. Also let $f(g(x)) = g(f(x))$ . Prove that there exists $c$ from $[0,1]$ such that $f(c)=g(c)$. 
I will try with contradiction. Let $h(x) = f(x) - g(x) > 0$ for all $x$ from $[0,1]$. Since $f(x)$ maps from $[0,1]$ to $[0,1]$ and is greater then $g$ for all $x$ from $[0,1]$ then this implies that $g(x)$ is not an element of $[0,1]$ for all $x$ from $[0,1]$. This is a contradiction, so there exists $c$ from $[0,1]$ such that $f(c)=g(c)$. Problem here is that I never used fact that 
$f(g(x)) = g(f(x))$ which bothers me. Is proof correct or there is hole somewhere?
 A: Without loss of generality some $\epsilon >0$ exists such that $f(x)\geq g(x)+\epsilon$ for all $x\in [0,1]$.
Take $n\in \mathbb Z^+$.
We now prove $f^n\geq g^n + n\epsilon$ for all $n\in \mathbb Z^+$.
We proceed by induction, $n=1$ is clear.
Inductive step: $f^{n+1}(x)\geq g(f^n(x))+\epsilon = f^n(g(x))+\epsilon \geq g^{n}(g(x))+n\epsilon+\epsilon=g^{n+1}(x)+(n+1)\epsilon$.
This is clearly a contradiction for $n\epsilon > 1$.
A: The flaw in your proof (unless I misunderstood what you're doing) is that you're taking the statement "$f$ is a mapping from $[0,1]$ to $[0,1]$" as "$f$ maps $[0,1]$ to $[0,1]$" (i.e. $f([0,1])=[0,1]$). This is not the case—$f$ need not be surjective.
A proof of the result you seek:


*

*$f\colon[0,1]\to[0,1]$ is continuous, so there exists a fixed point $a\in[0,1]$: $f(a)=a$.

*by contradiction, assume there is no $x\in[0,1]$ s.t. $f(x)=g(x)$; that is, the continuous function $h=f-g$ is always (wlog) $>0$. 


*

*define the sequence of iterations of $g$ on $a$: $u_n=g^{(n)}(a)$ (so that $u_0=a$). Using $f\circ g=g\circ f$, one easily gets $f(u_n)=u_n$ for all $n\geq 0$.

*but then, since $h>0$, $u_n-u_{n+1} = h(u_n) > 0$. The sequence $(u_n)$ is decreasing (and bounded below by $0$) so converges: there exists $\ell \in [0,1]$ such that
$$ u_n\xrightarrow[n\to\infty]{} \ell$$

*by continuity of $f$, recalling that $u_n=f(u_n)$, you get $f(\ell)=\ell$.

*by continuity of $g$, recalling that $u_{n+1}=g(u_n)$, you get $g(\ell)=\ell$.

*overall, this implies $f(\ell)=g(\ell)$, hence a contradiction.


A: We first suppose $f$ is increasing on $[0, 1]$.Let $h(x) = g(x) - x$, then $h$ is continous on $[0, 1]$, and $h(0) = g(0) > 0$ and $h(1) = g(1) - 1 < 0$. So the intermediate value theorem implies there is an $r$ in $[0, 1]$ with $h(r) = 0$ or $g(r) = r$.
Now if $f(r) = r$, then we're done. If $f(r) \ne r$, define a sequence $x(1) = f(r)$, and $x(n+1) = f(x(n))$, $n > 1$ or $n = 1$. Now if $r < f(r) \implies \{x(n)\}$ increases, and if $r > f(r) \implies \{x(n)\}$ decreases. In both cases $\lim x(n)$ exists and $= c$. By using $f(g(x)) = g(f(x))$ and induction we have: $g(x(n)) = x(n)$ for all $n$'s. So:
$$f(c) = f(\lim x(n)) = \lim f(x(n)) = \lim x(n) = c \\ g(c) = g(\lim x(n)) = \lim g(x(n)) = \lim x(n)  = c \\ \implies f(c) = g(c).$$
A: Your proof is wrong.  Why should $g(x)$ not be an element of $[0,1]$?  For example, why couldn't you have $f(x) \in [2/3, 1]$ and $g(x) \in [0,1/3]$ for all $x$? 
