Surjective Monotone Function is Continuous

Theorem
Let $X$ be an open subset of $\R$.

Let $Y$ be a real interval.

Let $f: X \to Y$ be a surjective,   monotone, real function.

Then $f$ is continuous on $X$.