Given a continuous function $f:\mathbb{R}\rightarrow\mathbb{R}$, let $[a,b]$ and $[c,d]$ be intervals in $\mathbb{R}$ such that
$[c,d]\subset f([a,b])$, $[a,b]\subset f([c,d])$, and $[a,b]\cap[c,d]=\emptyset$.
Show that $f$ has a periodic point with period $2$, i.e. $f^2(x)=x$ but $f(x)\neq x$.
My attempt: I think I'm most of the way done with the proof, I'm just having trouble showing that while $f^2(x)=x$ for some point, $f(x)\neq x$. Here it is:
By the Intermediate Value Theorem, we know $\forall v\in[a,b]\subset f([c,d])$, $\exists h \in [c,d]$ such that $f(h)=v$. Choose $v=a$, i.e. let $h$ be the element of $[c,d]$ such that $f(h)=a$.
We also have, by the Intermediate Value Theorem, that $\forall h \in [c,d]\subset f([a,b])$, $\exists g\in[a,b]$ such that $f(g) = h$. Thus, we have $f^2(g) = f(f(g))=f(h)=a$.
Suppose by way of contradiction that $f$ has no periodic point with period 2. Then, since $f(f(x))\neq x$, either $f(f(x))>x$ or $f(f(x))
How do I show there is a point such that $f^2(x)=x$ holds, but $f(x)=x$ does not?