Let $f$ be a bounded function on a compact interval $J$, and let $I(c,r)$ denote the open interval centered at $c$ of radius $r > 0$. Let $\text{osc}(f,c,r) = \sup |f(x)-f(y)|$, where the supremum is taken over all $x,y \in J\cap I(c,r),$ and define the oscillation of $f$ at $c$ by $\text{osc}(f,c)=\lim_{r \rightarrow 0}\text{osc}(f,c,r)$. Clearly, $f$ is continuous at $c\in J$ if and only if $\text{osc}(f,c)=0.$
For every $\varepsilon >0,$ the set of points $c\in J$ such that $\text{osc} (f,c)\geq \varepsilon$ is compact.
I have two proofs below that I think do the trick.
$\textbf{First Proof}$: First note that the set in question, call it $\mathcal{C}$ is bounded, so it suffices by Heine-Borel to prove that its complement is open. We will prove that every point of $\mathcal{C}^\complement$ is an interior point. So let $c \in \mathcal{C}^\complement$ be arbitrary but fixed.
By definition, we can choose $\delta>0$ small enough so that $\text{osc}(f,c,\delta) = \sup |f(x)-f(y)|<\varepsilon$, where the supremum is taken over all $x,y\in\mathcal{B}(c,\delta).$ Then for any $a\in\mathcal{B}(c,\delta),a\ne c,$ we can choose $p>0$ with $p<\delta$ small enough, so that we have $\text{osc}(f,a,p) = \sup |f(x)-f(y)|<\varepsilon.$ Therefore $\lim_{r \rightarrow 0}\text{osc}(f,a,r)<\varepsilon.$ It follows that $c\in \mathcal{C}^{\complement}$ is an interior point. Since $c$ was arbitrary, we see that $\mathcal{C}^{\complement}$ open, so that $\mathcal{C}$ is closed, and since it is also bounded, it is compact.
$\textbf{Second Proof}$: We prove that $\mathcal{C}$ is closed by showing it contains all its limit points. So let $c$ be a limit point of $\mathcal{C}.$ Then for any $\delta>0$, we have that $(\mathcal{B}(c,\delta)-\{ c \})\cap\mathcal{C}\ne\emptyset$. This means that $\text{osc}(f,c)=\lim_{r \rightarrow 0}\text{osc}(f,c,r)\geq\varepsilon,$ since we can choose $\delta>0$ so small that for some $a\in(\mathcal{B}(c,\delta)-\{ c \})$ we have that $\text{osc}(f,a,\delta) = \sup |f(x)-f(y)|\geq\varepsilon,$ and hence $\text{osc}(f,c,p) = \sup |f(x)-f(y)|\geq\varepsilon,$ for some small enough $p>0$ with $p<\delta$. Since $\delta\geq 0$ was arbitrary, the result about the oscillation at $c$ follows. Therefore $c\in \mathcal{C},$ so the latter is closed.
Is the above proof correct? Any feedback is welcomed and much appreciated, be it about the style or the argument, or both.
Thank you for your time.
The proofs are more or less acceptable. The first proof has some minor flaws.
If you care about making a complete and precise argument, then in the first proof you state but do not justify why $\text{osc}(f,a,p) < \epsilon.$
The argument would be as follows. Given $\beta$ such that $\text{osc}(f,c) < \beta < \epsilon$ there exists $\delta$ such that $\text{osc}(f,c,\delta) \leqslant \beta.$ Since $\mathcal{B}(a,p) \subset \mathcal{B}(c,\delta)$ it follows that for all $x,y \in \mathcal{B}(a,p) \cap J$,
$$|f(x) - f(y)| \leqslant \sup_{u,v \in \mathcal{B}(c,\delta)\cap J}|f(u) - f(v)| = \text{osc}(f,c) \leqslant \beta < \epsilon$$
Thus,
$$\text{osc}(f,a,p) =\sup_{x,y \in \mathcal{B}(c,\delta)\cap J}|f(u) - f(v)| \leqslant \beta < \epsilon, $$
and
$$\text{osc}(f,a) = \inf_{r} \,\text{osc}(f,a,r) \leqslant \beta < \epsilon,$$
which implies that $\mathcal{B}(c,\delta) \cap J \subset \mathcal{C}^c$.