Prove that a monotone and surjective function is continuous Let $I$ be a interval and $f:I \rightarrow \mathbb{R}$ monotone and surjective prove that $f$ is continuous.
I tried using the definition of $\epsilon$-$\delta$ and supposing that $f$ is not continuous but I don't see where use that $f$ is surjective.
 A: Assume, without loss of generality, that $f$ is monotone increasing. Let $x_0\in I$ and $\varepsilon>0$.
Take rationals $$q_l\in\big(f(x_0)-\varepsilon,f(x_0)\big) \text{ and }q_r\in\big(f(x_0),f(x_0)+\varepsilon\big)$$
Since $f$ is surjective, then there exists an $x_l,x_r\in I$ such that $f(x_l)=q_l$ and $f(x_r)=q_r$. Note that we must have $x_l<x_0<x_r$. Set $$\delta=\min\left\{x_0-x_l,x_r-x_0\right\}$$
Let $x\in I$ with $|x-x_0|<\delta$. Without loss of generality, suppose $\delta=x_r-x_0$. Then we have $$x_l-x_0<x_0-x_r<x-x_0<x_r-x_0$$ thus $$x_l<2x_0-x_r<x<x_r$$ which implies that, since $f$ is monotone, we have $$f(x_0)-\varepsilon<f(x_l)\leq f(x)\leq f(x_r)< f(x_0)+\varepsilon $$ which implies $$-\varepsilon<f(x)-f(x_0)<\varepsilon$$ and completes the proof.
A: You can also carry out this proof using the theorem that a function is continuous if and only if the inverse image of all closed sets are closed.
Continuity is usually defined by saying that the inverse image of open sets are open.

Let $I$ be an open interval in $\mathbb{R}$ and let $f$ be a function from $I$ to $\mathbb{R}$.
By monotonicity of $f$, we know that
$$a \le e \implies f(a) \le f(e) \;\; \text{for all $a$, $e$ in $\mathbb{R}$}$$
We also know the following, by the trichotomy of the reals and contrapositive
$$ f(a) > f(e) \implies a > e \;\; \text{for all $a$, $e$ in $\mathbb{R}$} $$
We also know that $f$ is surjective, i.e.
$$ f^\to(I) = \mathbb{R} $$
Fix a closed interval $\sigma$ in $\mathbb{R}$.
Let $\beta$ be $f^{\leftarrow}(\sigma)$.
By surjectivity, $\beta$ is nonempty.
By monotonicity, $\beta$ is an open, half-open, or closed interval. For every pair of points $a$ ane $e$ in $\beta$, all points $i$ between $a$ and $e$ are also in $\beta$.
Suppose $\beta$ does not contain its top limit point, then $f(\text{lub}(\beta))$ is outside $\sigma$. By monotonicity of $f$, $f(\text{lub}(\beta))$ is greater than $\text{lub}(\sigma)$. Therefore there is a gap between $f^\to(\beta)$ and $f(\text{lub}(\beta))$. By monotonicity, this would mean that $f$ is not surjective, which is a contradiction.
Suppose $\beta$ does not contain its bottom limit point, then there is a gap between $f(\text{glb}(\beta))$ and $f^\to(\beta)$. By monotonicity and surjectivity of $f$, this means that no value can be sent to the gap. This is a contradiction.
Therefore, $f^{\leftarrow}(\sigma)$ is an interval that contains both its limit points. Therefore $\beta$ is a closed interval.
Since the inverse image of all closed intervals are closed, this means that the inverse image of any closed subset of $\mathbb{R}$ is closed.
Thus $f$ is continuous.
A: If Intermediate Value Property is known that can be used here. A monotone function that satisfies IVP is continuous. See this and this.
So it's enough  to show that $f$ has IVP. Let $f$ be monotone increasing on $I$ (otherwise we can use $-f$). Let $x_1<x_2 \in I$ and $f(x_1)<\mu<f(x_2)$, $\exists~~ c \in I$ such that $f(c)=\mu$. Monotone increasingness of $f$ ensures that $c \in (x_1, x_2)$.
A: choose a point 'a' from I. Wlog choose a is an interior point, then there exists an open interval $(x_1, x_2)$ in I containing a, now since f is monotone (wlog, assume increasing) $f(x_1)\leq f(a)\leq f(x_2)$. let $$p= min\{f(a)-f(x_1),f(x_2)-f(a)\}$$ now $f(a)-p$ and $f(a)+p$ will belong to f(I), and since f is surjective they have a preimage, say $r$ and $s$ respectively,(by contrapositive since f is increasing
$$f(x)\leq f(y) \leq x \leq y, r \leq a \leq s)$$ now take
$$ delta1 = min \{a-r, s-a\} $$
=> $r \leq (a-delta1) \leq a \leq (a+delta1) \leq s)$
now epsilon be given, if $epsilon > p$, then delta1 works by epsilon-delta definition of continuity,
now, say epsilon is less than p, then f(a)-epsilon and f(a)+epsilon must have a preimage(because f is surjective) say c and d respectively, now take delta=min{a-c, d-a} this delta will work.. why? draw pictures and check.. this is a easy nice proof, use geometry and you'll never forget this proof...
