Monotone Real Function with Everywhere Dense Image is Continuous

Theorem
Let $I$ and $J$ be intervals.

Let $f: I \to J$ be a monotone   real function.

Let $f \left[{ I }\right]$ be everywhere dense in $J$, where $f \left[{ I }\right]$ denotes the  image of $I$ under $f$.

Then $f$ is continuous on $I$.