TITLE: 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]$?
QUESTION [6 upvotes]: 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.

REPLY [2 votes]: 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]$.