# Map preserving intervals but discontinuous

Let $f:\mathbb{R}\to\mathbb{R}$ be a map sending closed intervals to closed intervals. Prove that $f$ is continuous or find a counter example.

WLOG we just have to prove continuity at $0$ and we can also assume that $f(0)=0$ and $f(1)=1$ (by considering $x\mapsto (f(x)-f(0))/(f(1)-f(0))$ ).

I build up this question while thinking of the question Mappings preserving convex polyhedra.

• You tagged it with "compactness" but didn't make any mention in the question, so I feel like some telepathy (or some subliminal messaging) might be going on here. Can you clarify any hypotheses you are thinking of? May 5 '14 at 20:07
• @rschwieb It is useful to note that closed intervals are precisely the compact connected subsets of $\mathbb R$. May 5 '14 at 20:09
• @AlexBecker It's useful to know that's what the poster means by closed intervals, too, if that's the case. May 5 '14 at 20:10
• @rschwieb, I had in mind that closed and bounded interval are the compact sets. Sorry for not mentioning it in the post. May 5 '14 at 20:12
• @GillesBonnet Thanks! That makes everything clear. May 5 '14 at 20:13

This is false. Consider $$f(x)=\begin{cases} \sin \frac{1}{x} & x\ne 0\\ 0 &x = 0 \end{cases}$$ which is discontinuous at $0$. However, for any closed interval $I$ not containing $0$, we have that $f(I)$ is a closed interval since $f$ is continuous on $I$, and for any closed interval $I$ containing $0$ we have $f(I)=[-1,1]$.
• @AlexBecker, $\frac{\sin x}{x} \rightarrow 1^-$ when $x\rightarrow 0$ so the image of $(-\varepsilon,\varepsilon)$ (for $\varepsilon$ small enough)its of the form $\{0\}\cup (1-\delta,1)$ tha it isnt a closed interval May 5 '14 at 20:18
A closed map* is not necessarily continuous. As mentioned in e.g., Wikipedia's page, the argument function assigning to a point p in $S^1$ its "total argument" (in the range $[0, 2\pi)$), i.e., the arc-length in radians at any x in $S^1$ , measured from a fixed point p, is both open, closed, but not continuous ; specifically near the fixed point $p$ , where the value goes from being close to $2\pi$ to being $0$.