$f(g(x))=g(f(x))$ implies $f(c)=g(c)$ for some $c$
Solution 1:
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.
Solution 2:
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$.