User:Keith.U/Sandbox

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$.

Proof
Let $L^{-}$, $L$, and $L^{+}$ denote $\displaystyle \lim_{ x \to c^{-} } f \left({ x }\right)$, $f \left({ c }\right)$, and $\displaystyle \lim_{ x \to c^{+} } f \left({ x }\right)$, respectively.

Suppose $f$ is increasing.

Suppose $f$ is discontinuous at $c \in I$.

From Discontinuity of Monotonic Function is Jump Discontinuity:
 * $ L^{-} \neq L^{+}$

Since $f$ is increasing:
 * $ L^{-} \leq L \leq L^{+}$

Let $S = \left({ L^{-}, \,.\,.\, L^{+} }\right)$

If $ L^{-} = L = L^{+}$, then $c$ is not a discontinuity, a contradiction.

Thus $S$ is non-degenerate.

From Non-Degenerate Real Interval is Infinite, $S$ is infinite.

From Relative Difference between Infinite Set and Finite Set is Infinite, $S \setminus \left\{ { L } \right\}$ is non-empty.

From Finite Subset of Metric Space is Closed, $\left\{ { L } \right\}$ is closed.

From Open Set minus Closed Set is Open, $S \setminus \left\{ { L } \right\}$ is open.

Lemma
From the Lemma:
 * $ S \cup f \left[{ I }\right] \subseteq \left\{ { L } \right\}$

Thus:

Thus, there exists a non-empty  open  subset of $f \left[{ I }\right]$ that is  disjoint from $Y$.

From Open Set Characterization of Denseness, $f \left[{ I }\right]$ is not everywhere dense in $J$.

This contradicts that $f \left[{ I }\right]$ is everywhere dense in $J$.

Therefore $I$ contains no discontinuities, by Proof by Contradiction.

Hence the result.