TITLE: Prove that $f$ is continuous in $\mathbb{R}$
QUESTION [6 upvotes]: Let  $f:\mathbb{R} \to \mathbb{R}$ be a monotone function such that $f(V)$ is open for every open set $V\subset \mathbb{R}$. Prove that $f$ is continuous in $\mathbb{R}$. 
Any hint for proving this I will appreciate.

REPLY [4 votes]: Without loss of generality we may assume that $f$ is non decreasing.
First, note that $f$ is injective. Suppose $f(x_1) = f(x_2)$, then if $x_1<x_2$,
the set $(x_1,x_2)$ would be open and the set $f((x_1,x_2)) = \{ f(x_1) \}$ is not open which is a contradiction. Hence $f$ is injective.
Now I claim that $f(\mathbb{R})$ is connected (that is, an interval). Suppose that there is some $y_0 \in (\inf f, \sup f) \setminus f(\mathbb{R})$ (note 
that $f(\mathbb{R}) \subset (\inf f, \sup f)$).
Then $I_-=f^{-1}((-\infty, y_0)), I_+f^{-1}((y_0, \infty))$ form a partition of $\mathbb{R}$ into two intervals.
There are two possibilities: (i) $I_- $ has the form $I_- = (-\infty, x_0]$, with
$f(x_0) < y_0$  and $y_0 < f(x) $ for all $x > x_0$. In particular,
$f(x_0) \in f(\mathbb{R})$ but $(f(x_0), y_0) \cap f(\mathbb{R}) = \emptyset$,
and hence $f(\mathbb{R})$ is not open.
(ii) $I_+ $ has the form $I_+ = [x_0, \infty)$, and a similar analysis
leads to the same contradiction.
Hence $f(\mathbb{R}) = (\inf f, \sup f)$,
in particular, it is an interval.
Now pick $x_0$, $\epsilon >0$. Choose $0< \epsilon' \le \epsilon$ such that
$\inf f < f(x_0) - \epsilon'$ and $f(x_0)+ \epsilon' < \sup f$. Now
choose $x_-, x_+ $ such that $f(x_-) = f(x_0) - \epsilon'$ and
$f(x_+) = f(x_0) + \epsilon'$.
Note that $x_- < x_0 < x_+$ and let $\delta = \min (x_0-x_-, x_+-x_0)$.
Then if $|x-x_0| < \delta$, we have $|f(x)-f(x_0)| < \epsilon' \le \epsilon$.