TITLE: If $f^{-1}(I)$ is connected for connected $I$ then $f$ is monotone.
QUESTION [1 upvotes]: Let $f:[0,1] \to \mathbb R$.

Claim: If $f^{-1}(I)$ is connected for all connected $I \subseteq \mathbb R$ then $f$ is monotone.

Assume $f(0) \leq f(1)$. I want to show that $f$ is monotone increasing. 
I would appreciate some hints. Arguing by contradiction doens't give me more possibilities.

Further, a set $I$ is connected iff $\forall x,y \in I: x< y \Rightarrow [x,y] \subset I$.

REPLY [0 votes]: Suppose $f$ isn't monotone. Then without loss of generality there are values $0 \le a < b < c \le 1$ with $f(a) < f(b)$ and $f(c)<f(b)$. [The other possibility is $f(a)>f(b)$ and $f(c)>f(b)$, in which case we can replace $f$ by $-f$ and repeat the argument.]
Now suppose $f(a) \le f(c)$ and consider the interval $I=[f(a),f(c)]$. Can $f^{-1}(I)$ be connected?
(If $f(c) \le f(a)$ then consider $[f(c),f(a)]$ instead.)
{"set_name": "stack_exchange", "score": 1, "question_id": 556327}