If $f:\mathbb{R}\to\mathbb{R}$ is continuous and $[a,b]\subset f([c,d])$, how to prove there is some $[r,s]$ such that $f([r,s])=[a,b]$? Let  $f:\mathbb R\to\mathbb R$ satisfy the following:

  
*
  
*$f$ is continuous  
  
*there exist closed intervals $[a,b]$ and $[c,d]$ such that $[a,b]\subset f([c,d])$
  

How to prove that there exists $[r,s]\subset [c,d]$ such that $f([r,s])=[a,b]$ ?
Thanks in advance.
 A: Select $x_1,x_2\in[c,d]$ with $f(x_1)=a$, $f(x_2)=b$.
Wlog. $x_1<x_2$ (or interchange $\min$ and $\max$ in what follows).
The set $f^{-1}(b)\cap[x_1,d]$ is compact, hence we can let $s=\min(f^{-1}(b)\cap[x_1,d])$ and similarly $r=\max(f^{-1}(a)\cap[c,s])$.
Then $[a,b]\subseteq f([r,s])$ by the intermediate value theorem and on the other hand if $f(x)<a$ for some $x\in[r,s]$ then there is $\xi\in(x,s)$ with $f(\xi)=a$ (again by IVT), contradicting maximality of $r$. Similarly, if $f(x)>b$, there is $\xi\in(r,x)$ with $f(\xi)=b$, contradicting minimality of $s$.
Therefore $f([r,s])=[a,b]$.
A: Edit: this Zorn approach came pretty naturally, so I'll leave it. But when one proves rigorously the very last step, one realizes that Zorn is not needed. And one ends up doing Hagen von Eitzen's proof.
Consider the set $S$ of all compact intervals $I\subseteq [c,d]$ such that $[a,b]\subseteq f(I)$. 
By assumption, $[c,d]$ belongs to $S$ which is therefore nonempty.
Now $S$ is partially ordered by inclusion.
One can check that every chain has a lower bound in $S$: it suffices to take the intersection of the elements of the chain.
By Zorn, there exists a minimal element $I_0$ in $S$.
Of course $[a,b]\subseteq f(I_0)$. 
By minimality, we must have $[a,b]=f(I_0)$.
