Monotonic function satisfying darboux property $\Rightarrow$ continuous 
Assume  $f : I \rightarrow \mathbb{R}$ is a non-decreasing on an open interval $I$ and that $f$ satisfies the Intermediate value property or Darboux's property on $I$ (that is, for any $a < b$ in $I$ and any $L$ between $f(a)$ and $f(b)$, there exists $c \in [a, b]$ such that $ f (c) = L)$.
Then, prove that $f$ is continuous.

However, I know that a function can be discontinuous and also satisfy the IVT at the same time.
Could someone point me in the right direction?
 A: A monotonic function can have only discontinuities of first kind or simple discontinuity.
The idea of the proof is that if $p$ is a point of discontinuity, then $f(p-)$ and $f(p+)$ exists and $f(p-)<f(p+)$. We can easily show that $$\color{red}l=\sup\limits_{a<t<p}f(t)=f(p-)<f(p+)=\inf\limits_{p<t<b}f(t)=\color{red}L.$$
Now using definition of $\sup$ and $\inf$, choose some $\varepsilon>0$ and there exists $r$ and $s$ such that $$ r<x_1<p\Rightarrow l-\varepsilon<f(x_1)\le l\\ p<x_2<s \Rightarrow L\le f(x_2)<L+\varepsilon$$
Observe that $f(x_1)<\dfrac{l+L}{2}<f(x_2)$ then by intermediate value property, there should be some $c\in (x_1,x_2)$ such that $f(c)=\dfrac{l+L}{2}$. A contradiction!
A: $f$ is non decreasing on $[a,b]$ then for any $x_1\leq x_2 \implies f(x_1)\leq f(x_2)$.
for $c\in [a,b]$, we want to prove that $f$ is continuous at $c$, so consider $\epsilon>0$. We want to find a delta such that $x\in (c-\delta,c+\delta) \cap [a,b] \implies |f(x)-f(a)|<\epsilon$.
So look in the interval $(f(a)-\epsilon,f(a)+\epsilon)$. We know that there exists $f(y)$ and $f(z)$ in $(f(a)-\epsilon,f(a)+\epsilon)$ such that $f(y)\leq f(a) \leq f(z)$ [IVT gurantees this]
So again by applying IVT, we get for all $x \in (y,z) \implies f(x) \in (f(a)-\epsilon,f(a)+\epsilon)$. choose $\delta = \min [\dfrac{z-a}{2},\dfrac{a-y}{2}]$
