ProofWiki: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 $f \left({ c^{-} }\right)$ and $f \left({ c^{+} }\right)$ denote $\displaystyle \lim_{ x \to c^{-} } f \left({ x }\right)$ and $\displaystyle \lim_{ x \to c^{+} } f \left({ x }\right)$, respectively.

Suppose $f$ is increasing.

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

Since Discontinuity of Monotonic Function is Jump Discontinuity and $f$ is increasing:
 * $ f \left({ c^{-} }\right) < f \left({ c^{+} }\right)$

Since $f$ is increasing:
 * $ f \left({ c^{-} }\right) \leq f \left({ c }\right) \leq f \left({ c^{+} }\right)$

If $ f \left({ c^{-} }\right) = f \left({ c }\right) = f \left({ c^{+} }\right)$, then $c$ is not a discontinuity.

So $f \left({ c^{-} }\right) \neq f \left({ c }\right) \lor f \left({ c }\right) \neq f \left({ c^{+} }\right)$.

Since $ f \left({ c^{-} }\right) \neq f \left({ c^{+} }\right)$:

From Real Numbers are Uncountable:
 * $ \left({ f \left({ c^{-} }\right), \,.\,.\, f \left({ c^{+} }\right) }\right)$ is infinite.

From Relative Difference between Infinite Set and Finite Set is Infinite:
 * $ \left({ f \left({ c^{-} }\right), \,.\,.\, f \left({ c^{+} }\right) }\right) \setminus \left\{ { f \left({ c }\right) } \right\}$ is infinite.

Lemma
Suppose $z \in \left({ f \left({ c^{-} }\right), \,.\,.\, f \left({ c^{+} }\right) }\right) \cap f \left[{ I }\right]$

Then $z = f \left({ c }\right)$.

Proof of Lemma
Suppose $z \in \left({ f \left({ c^{-} }\right), \,.\,.\, f \left({ c^{+} }\right) }\right) \cap f \left[{ I }\right]$

Then:
 * $\exists p \in I : f \left({ z }\right) \in \left({ f \left({ c^{-} }\right), \,.\,.\, f \left({ c^{+} }\right) }\right)$

Case 1: $p < c$

$p < c \implies f(p) \leq f(c)$

Case 2: $p = c$

$p = c \implies f(p) = f(c)$

Case 3: $p > c$

blabla

Thus:
 * $ \left({ f \left({ c^{-} }\right), \,.\,.\, f \left({ c }\right) }\right) \cup \left({ f \left({ c }\right), \,.\,.\, f \left({ c^{+} }\right) }\right) \cap f[I] = \nothing$

Contradiction to everywheredense