Lef $f:[a,b] \rightarrow \mathbb{R}$ be a monotone function on $[a,b]$ which satisfies: if $L$ is a real number such that $f(a)<L<f(b)$ or $f(a)>L>f(b)$, then there exists a point $c\in (a,b)$ where $f(c)=L.$ If the preceding conditions are met, then $f$ is continuous on $[a,b]$.
I want to show that given $c \in (a,b)$, for all $\epsilon>0$, there exists a $\delta>0$ such that $|x-c|<\delta \implies |f(x)-f(c)|<\epsilon$.
Since $f$ is monotone, WLOG $f(a)\leq f(c)(\text{ Otherwise }-f)$. If $f(c)-\frac{\epsilon}{2}<f(a)$ then
set $x_1=a$ then $\forall x\in(x_1,c]$ $$f(c)-\frac{\epsilon}{2}\leq f(x_1)\leq f(x)\leq f(c)$$ If $f(c)-\frac{\epsilon}{2}\geq f(a)$ then $f(a)\leq f(c)-\frac{\epsilon}{2}<f(c)\stackrel{\text{IVP}}{\implies}\exists x_1(a<x_1<c)\text{ s.t. }f(x_1)=f(c)-\frac{\epsilon}{2}$. Then $\forall x\in(x_1,c]$ $$f(c)-\frac{\epsilon}{2}= f(x_1)\leq f(x)\leq f(c)$$ Either case $\forall x\in(x_1,c]\implies f(c)-\frac{\epsilon}{2}\leq f(x_1)\leq f(x)\leq f(c)$.
We can follow a similar process on the other side to get that there exists a point $x_2>c$ with the property that $f(c)\leq f(x)\leq f(x_2)\leq f(c)+\frac{\epsilon}{2}$ whenever $x\in [c,x_2)$.
Finally, I set $\delta=\min\{c-x_1,x_2-c\}$, and it follows that $$f(c)-\frac{\epsilon}{2}\leq f(x)\leq f(c)+\frac{\epsilon}{2}\text{ provided }|x-c|<\delta$$This completes the proof.
Is this correct?