# Let $I$ be an interval, $f:I \rightarrow \mathbb{R}$ is a monotone function. Prove that if $f(I)$ is an interval, then $f$ is continuous

Let $I$ be an interval, $f:I \rightarrow \mathbb{R}$ is a monotone function. Prove that if $f(I)$ is an interval, then $f$ is continuous.

What I did was: supose f is monotone non decreasing (argument is similar if f is increasing, non increasing and decreasing)

Let $a \in I \implies f(a) \in f(I)$. Let $\epsilon>0$.

As $f(I)$ is an interval $\forall y \in [f(a)-\epsilon, f(a)+\epsilon]\cap f(I)\, \exists x \in I$ s.t. $f(x)=y$.

Let $W:=[f(a)-\epsilon, f(a)+\epsilon]\cap f(I)$

Since $W\subseteq [f(a)-\epsilon, f(a)+\epsilon]$ then it is limited and $f(a)$ belongs to it, therefore there is an inf and a sup.

Let $\alpha = \inf W$ and $\beta = \sup W$. Then $f(y)\in [\alpha,\beta]$.

$a \in I$ then $a$ is an interior point or a is a border($I = [a,*$ or $I=*,a]$).

## If $a$ is an interior point

let $\delta>0$ such that $[a-\delta, a+\delta] \subseteq I$ and $f(a-\delta)\leq\alpha$ and $f(a+\delta)\geq \beta$.

Then $y\leq a-\delta$ or $y\geq a+\delta$ or $y\in [a-\delta, a+\delta]$.

if $y\leq a-\delta \implies f(y)\leq f(a-\delta)<\alpha$ which is a contradiction.

if $y\geq a-\delta \implies f(y)\geq f(a-\delta)>\beta$ which is a contradiction.

therefore exists $\delta$ such that $y\in [a-\delta, a+\delta] \implies |f(x)-f(a)|\leq \epsilon$

## if $a$ is a border point

supose $I=[a,*$ (argument similar for the other case):

then exists $\delta>0$ such that $[a, a+\delta]\subseteq I$ and $f(a+\delta)>\beta$. Then $y\in [a,a+\delta]$ or $y\geq a+\delta$, ($y<a-\delta$ is not possible since $a-\delta \not \in I$).

if $y>a+\delta\implies f(y)>f(a+\delta)>f(a)+\epsilon$ which is a contradiction, therefore exists $\delta>0$ such that $y \in [a-\delta, a+\delta] \implies |f(x)-f(a)|\leq \epsilon$.

therefore f is continuous.

Is this correct? I'm not sure if I can choose $\delta$ that obeys those restrictions. Is there a simpler way to prove this?

Let $f$ be nondecreasing. Prove that, if $a$ is an interior point of $I$, then \begin{align} \lim_{x\to a^-}f(x)&=\sup\{f(x):x\in I, x<a\} \\[4px] \lim_{x\to a^+}f(x)&=\inf\{f(x):x\in I, x<a\} \end{align} In particular $$\lim_{x\to a^-}f(x)\le \lim_{x\to a^+}f(x)$$ If they're not equal, then the middle point does not belong to the image of $f$.
For boundary points of $I$ it's similar.