Prove that an increasing and surjective function is continuous. If $f:[a,b]\rightarrow [f(a),f(b)]$ is increasing and surjective, prove that it is continuous.
Fix $c \in (a,b)$. Take $\epsilon >0$. We then wish to find the set of $x$ such that $|f(x)-f(c)|<\epsilon$ by definition of continuity.
That's as far as I got and I don't know how to proceed. Any suggestions/proofs?
 A: Well, let's try to do this using just the basic, strict, definition of $(\epsilon,\delta)-$continuity.
Recall that surjectivity means that for all $z\in [f(a),f(b)]$, there exists a $x\in [a,b]$ such that $f(x)=z$ and that being increasing (not strictly) means that if $x\leq y$, then $f(x)\leq f(y)$.
Towards a contradiction, for it to be non continuous in a point $c$, you need an $\epsilon >0$ such that $\forall\delta>0, \exists y\in]c-\delta, c+\delta[$ such that $\mid f(y)-f(c)\mid \geq \epsilon$.
But then, if there exists such an $\epsilon$ and such a $y$, it would means that in the interval $[f(y),f(c)]$ (wlog $f(y)<f(c)$, note $y\neq c$), is of length at least $\epsilon$, so there exists values inside and by surjectivity, those values have an preimage : $\forall z\in \; ]f(y),f(c)[, \; \exists x\in[a,b]$ such that $f(x)=z$. 
But now, $f(a)\leq f(y)< f(x)< f(c) \leq f(b)$ implies by monotonicity (being increasing here) that $x\in\;]y,c[\; \subset\; ]c-\delta,c+\delta [$. This does the magic and comes from the fact that if $A\implies B$, then $\neg(B) \implies \neg(A)$.
So, since this is true $\forall\delta$ and $\forall z$, we can pick $\delta=\epsilon$ for example and $z=f(c)-\frac{\epsilon}{2}$, we have that there exists an element $x$ in $]y,c[$ such that $f(x)=f(c)-\frac{\epsilon}{2}>f(y)$, so $\mid f(x)- f(c) \mid = \mid f(c)-\frac{\epsilon}{2}-f(c)\mid=\frac{\epsilon}{2}<\epsilon$, which means that for $\delta = \epsilon/2$, then the value $y'\in ]c-\frac{\epsilon}{3},c+\frac{\epsilon}{3}[$ so that $\mid f(c)-f(y')\mid \geq \epsilon$ (which has to exists since we assumed non-continuity) can not be in $]c-\frac{\epsilon}{3},c[$ since we have monotonicity implying $f(x)\leq f(y')\leq f(c)$ if it were there and $f(x)$ being at distance $\epsilon/2<\epsilon$ from $f(c)$ and so, $y' \in ]c,c+\frac{\epsilon}{3}[$ is such that $\mid f(y')-f(c) \mid \geq \epsilon$ implies that we have a non empty interval of length $\epsilon$ there were we can pick the value $f(c)<f(c)+\frac{\epsilon}{4}<f(y')$ and there exists again a $x'\in ]c,c+\frac{\epsilon}{3}[$ such that $f(x')=f(c)+\frac{\epsilon}{4}$, so $\mid f(x')-f(c)\mid = \frac{\epsilon}{4}$. 
But then it means that we have found an interval around $c, [x,x']$ such that $f(x)-f(x') = f(c)-\frac{\epsilon}{2}-f(c)-\frac{\epsilon}{4} = \frac{3}{4}\epsilon < \epsilon$ so every possible value $x\leq z\leq x'$ is such that $f(c)-\frac{\epsilon}{2}<f(z)<f(c)+\frac{\epsilon}{2}$ which means that for $\delta=\min\{\mid x'-c\mid,\mid x-c\mid\}$ there are no $y'' \in \big[c-\delta, c+\delta\big]$ such that $\mid f(y'')-f(c)\mid \geq \epsilon$ which is a blatant contradiction of our assumption that it wasn't continuous. 
PS : this is not "enough" in the sense that I do not talk about the extrema, but you can do it there using the same method. And you may need to be more careful here and there when taking open/closed intervals.
A: Take $c\in (a,b)$, and let $\epsilon>0$ be given; assume for now that $f(c)+\epsilon\leq f(b)$ and $f(c)-\epsilon\geq f(a)$. Then by surjectivity there exist $x_1,x_2\in[a,b]$ such that $f(x_1)=f(c)-\epsilon$ and $f(x_2)=f(c)+\epsilon$. Set $\delta=\min\{c-x_1,x_2-c\}$, and use the fact that $f$ is increasing.
If you can't shrink $\epsilon>0$ so that $f(c)+\epsilon\leq f(b)$ and $f(c)-\epsilon\geq f(a)$, then $f(c)=f(b)$ and/or $f(c)=f(a)$, so you will have to deal with these cases. Can you finish it from here?
A: Sincé $f$ is increasing, $f(x^+)$ and $f(x^-)$ both exist. Furthermore 
$\tag 1f(x^-)\le f(x)\le f(x^+).$ 
Now, suppose there is a point $c\in [a,b]$ at which $f$ is not continuous. Then, there are two possibilities: 
$a). f(x^-)=f(x^+)$ in which case $f(c)\neq f(x^+)$ because $f$ is assumed discontinuous at $c$. But this contradicts $1).$
$b). f(x^-)<f(x^+),$ in which case at least one of $[f(x^-),f(c)]$ or $[f(c), f(x^+)]$ is a non-degenerate interval, which contradicts the surjectivity of $f$. 
A: Here is a unique perspective on the problem: Let $[a,b] \subset [0,1]$. This splits $[0,1]$ into two more intervals, $[0,a)$ and $(b, 1]$. Note that
$$f^{-1}[0,a) \cup f^{-1}[a,b] \cup f^{-1}(b,1] = C$$
and as $f$ is surjective, $[a,b]$ actually exists in the image of $f$.
Also, because $f$ is increasing,
$$\inf f^{-1}[0,a) \leq \inf f^{-1}[a,b] \leq \inf f^{-1}(b,1]$$
and 
$$\sup f^{-1}[0,a) \leq \sup f^{-1}[a,b] \leq \sup f^{-1}(b,1]$$
Thus as $C$ is an interval, it has to be $f^{-1}[a,b]$ which contains every value between $\inf f^{-1}[a,b]$ and $\sup f^{-1}[a,b]$, so $f^{-1}[a,b]$ is an interval.
The important bit is that $f^{-1}[a,b]$ is an interval. Specifically, it is a closed interval, as $\inf f^{-1}[a,b] = f^{-1}(a) \in f^{-1}[a,b]$ and $\sup f^{-1}[a,b] = f^{-1}(b) \in f^{-1}[a,b]$.
Thus, the pre-image of $f$ maps closed intervals to closed intervals $([a,b] \mapsto [f^{-1}(a), f^{-1}(b)])$, and by extension, closed sets to closed sets. So, $f$ is continuous.
A: Let $f:I = [a, b] \to J = [c, d]$ be surjective and non-decreasing and let $O_J \subset J$ be an open interval in $J$.
Note that intervals $[a, x), (x, b], [c, y), (y, d]$ which are half-open in the real line are open in the (subspace) topologies of the closed intervals $I, J$.
Firstly show that the pre-image $X = f^{-1}(O_J) \subset I$ is an interval, and secondly that it's open.
Then since open intervals are a topological basis for $J$ it follows that $f$ is continuous.....


*

*$X = f^{-1}(O_J) \subset I$ is an interval......
By definition, e.g. first paragraph of
https://en.wikipedia.org/wiki/Interval_(mathematics), if $X$ is not an interval
then there is some $x_1 < x_2 \in X $ with $x \not \in X$ and $x_1 < x < x_2$.
$x \not \in X \implies f(x) \not \in O_j$.
And $O_J$ is an interval and contains $f(x_1), f(x_2)$, so $f(x) \not \in O_j\implies f(x) < f(x_1) $ or $f(x) > f(x_2) $ either of which contradicts that $f$ is non-decreasing.

*$X = f^{-1}(O_J) \subset I$ is open......
$X$ is bounded below and therefore $x_{inf} = inf(x \in X)$ must exist.
If $c \in O_J$ (which it can be if $O_J$ is of the form $[c, y)$) then $x_{inf} = a \in X$ which doesn't conflict with $X$ being an open interval.
Otherwise....
Suppose that $x_{inf} \in X$ then $f(x_{inf}) = y \in O_J$.
Since $O_J$ is open and $y \not = c$  there is $y_0 \in O_J$ with $(c < ) y_0 < y$
And because $f$ is surjective there must be $x_0 \in I$ with $f(x_0) = y_0$
$f(x_0) = y_0 \in O_j \implies x_0 \in X$.
But as $f$ is increasing $f(x_0) = y_0 < y = f(x_{inf}) \implies x < x_{inf}$ which contradicts $x_{inf} = inf(x \in X)$.
So, either  $inf(x \in X) = a \in X$ or $inf(x \in X) \not \in X$
Similarly, $sup(x \in X) = b \in X$ or $sup(x \in X) \not \in X$.
X is therefore an open interval in the subspace topology of $I$.

A: Here's a simpler approach. Fix $\epsilon > 0, x_0 \in [a,b]$, and see that there must exist some (at least one) $x' \in [a, b]$ such that $|f(x') - f(x_0)| = \epsilon$ by surjectivity of $f$. Then see that for $\delta = |x' - x_0|$, any $x $ that is $\delta$-close to $x_0$ will have $|f(x) - f(x_0)|$ by monotonicity. You can graph a nondecreasing function to see this, by observing that, for instance, no $x > x_0$ that is $\delta$-close to $x_0$ can be further from $fx_0$ than $fx'$ is, since otherwise the function's graph would have to decrease from $fx$ to $fx'$, a contradiction. A symmetric argument applies to any hypothetical $x < x_0$. The requirement for $[a, b]$ and $[fa, fb]$ to be closed is just so that such $x_0, x'$ are guaranteed to exist to begin with.
