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 $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 $osc(f,c)=\underset{r\rightarrow 0}{\lim}osc(f,c,r)$. Clearly, $f$ is continuous at $c\in J$ if and only if $osc(f,c)=0$.
Prove that for every $\epsilon>0$, the set of points $c$ in $J$ such that $osc(f,c)\geq \epsilon$ is compact.
My Proof Attempt:
Proof. Let the assumptions be as above. Define \begin{equation*} D_n=\{c\in J: osc(f,c)\geq 1/n\} \end{equation*} We will prove that $D_n$ is compact and that $(D_n)_n$ is a decreasing nested sequence of sets. Since then \begin{equation*} D=\bigcap^{\infty}_{n=1}D_n \end{equation*} would be compact, since $D\subset D_n$ implies $D$ is bounded and arbitrary intersections of closed sets are still closed. Hence, the proof would follow as $D$ is the set of all points $c$ in $J$ such that $osc(f,c)\geq 1/n$ for all $n\in \mathbb{N}$, which is equivalent to the claim in the hypothesis.
So fix $n\in \mathbb{N}$. By definition, $D_n\subset J$. Thus, $D_n$ is a bounded set since $J$ is. Now we just need to show that $D_n$ is a closed set. Let $(s_k)_k\subset D_n$ be a convergent sequence such that $s_k\rightarrow s$. We will prove that $s$ must be in $D_n$. We will separate the case of $s\in J^{\circ}$ and $s\in \partial J$.(Where $J^{\circ}$ denotes the interior and $\partial J$ denotes the boundary).
Assume for now that $s$ is in the interior of $J$. Define \begin{equation*} \hat{I}(s,r)=J^{\circ}\cap I(s,r) \end{equation*} Fix $r>0$. Because $s_k\rightarrow s, \exists N\in \mathbb{N} $ such that for all $k\geq N$, we have $s_k\in \hat{I}(s,r)$. As $\hat{I}(s,r)$ is open, $\exists r'>0$ such that $I(s_k,r')\subset \hat{I}(s,r)$. Then by definition \begin{equation*} osc(f,s,r)\geq osc(f,s_n,r')\geq 1/n \end{equation*} As $r$ was arbitrary, this holds for all $r>0$. Hence, $osc(f,s)\geq 1/n.$ This implies that $s\in D_n$.
Now for the case that $s\in \partial J$. Since $J$ is a compact interval, it is closed and bounded.
Hence, the boundary of $J$, i.e. $\partial J$, is the set $\{\inf J, \sup J\}$ and denote the infimum and supremum as $\beta$ and $\alpha$, respectively.
Hence, $s=\beta$ or $s=\alpha$. For any $r>0$ sufficiently small, $J\cap I(s,r)$ is either the half-open interval $[s, s+r]$, or $[s-r,s]$. As $(s_k)_k$ was defined as a subset of $D_n$ and, thus, a subset of $J$, it follows that for sufficiently large $k$, $s_k$ in either of the intervals such that $s-r<s_k<s$ or $s<s_k<s+r$.
Hence, $s_k$ is contained in an open set within $J\cap I(s,r)$ and the conclusion of the former case holds by the same argument. This completes our proof.
Any corrections of the proof or comments on style are very much appreciated. Thank you guys for your time.
Here's an alternative proof:
Since $J$ is compact, it suffices to show that the set of $c\in J$ s.t. $osc(f,c)\ge \epsilon$ is closed. Let $(c_k)\rightarrow x$ be a sequence of such points converging to $x\in J$. We want to show that $osc(f,x)\ge \epsilon$.
For any $\delta>0$, choose $c_k$ s.t. $|x-c_k|<\delta/2$. Since $osc(f,c_k)\ge \epsilon$, we can find points $a,b$ in a ball of radius $\delta/2$ about $c_k$ with $|a - b|$ arbitrarily close to $\epsilon$. $a$ and $b$ lie within $\delta$ of $x$, so within any neighborhood of $x$ there are points $a,b$ with $|a-b|$ arbitrarily close to $\epsilon$. Hence $osc(f,x)\ge \epsilon$, as desired.