Real Function is Continuous at Point iff Oscillation is Zero

Theorem
Let $f: D \to \R$ be a real function where $D \subseteq \R$.

Let $\omega_f\left({I}\right)$ be the oscillation of $f$ over the interval $I = \left({a \,.\,.\, b}\right)$, that is:


 * $\omega_f \left({I}\right) = \sup \left\{{\vert f \left({x}\right) - f \left({y}\right) \vert: x, y \in I}\right\}$


 * $\omega_f \left({x}\right) = \inf \left\{{\omega_f \left({I}\right): x \in I}\right\}$

Then $\omega_f \left({x}\right) = 0$ iff $f$ is continuous at $x$.

Proof
While it is not strictly necessary for the interval $I$ to be open, $x$ must be a member of the open region of any interval $I$ to prevent right-continuous or left-continuous points from having $\omega_f \left({x}\right) = 0$.

For simplicity, we can take $I$ to be an open interval without loss of generality.

Necessary Condition
Suppose $\omega_f \left({x}\right) = 0$.

Let $\epsilon > 0$.

Suppose that $\forall I: x \in I, \omega_f \left({I} \right) \ge \epsilon$.

Then by definition, $\omega_f \left({x}\right) = \epsilon$.

From this contradiction we deduce that:
 * $\exists I: x \in I, \omega_f \left({I}\right) < \epsilon$.

For this particular $I = (a,b)$, let $\delta \in \R$ such that:
 * $\delta = \min\left\{x-a, b-x\right\}$

$\delta > 0$ because $a < x < b$ by the openness of $I$.

So for our specific $x$, if:
 * $\left \vert {x - y} \right \vert < \delta \implies x, y \in I$

then:
 * $\left \vert {f \left({x}\right) - f \left({y}\right)} \right \vert \leq \omega_f\left( I \right) < \epsilon$

This construction is valid for all $\epsilon$, so from the definition of continuity, we have that $f$ is continuous at $x$.

Sufficient Condition
Suppose $f$ is continuous at $x$.

Then $\forall \epsilon > 0: \exists \delta \in \R$ such that:
 * $\left \vert x-y \right \vert < \delta \implies \left \vert f \left({x}\right)-f \left({y}\right) \right \vert < \epsilon$

Let the interval $I_\delta$ be defined as:
 * $I_\delta := \left({x - \delta \,.\,.\, x + \delta}\right)$

Then:

This holds true for any value of $\epsilon$.

Thus $\omega_f \left({x}\right)$ must be $0$.

Hence the result.