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. Let $\epsilon > 0$. Define \begin{equation*} D_\epsilon=\{c\in J: osc(f,c)\geq \epsilon\} \end{equation*} It suffices to show that $D_\epsilon$ is closed as any closed subset of a compact set, in this case namely $J$, is also a compact set. Let $(x_n)_n\subset D_\epsilon$ such that $x_n\rightarrow x\in J$. We will prove that $x\in D_\epsilon$ and, thus, $D_\epsilon$ would be closed.
Claim: Since $x_n\in D_\epsilon$, that implies that for sufficiently small $\varrho$, \begin{equation*} osc(f,x_n,\varrho)\geq \epsilon \end{equation*} We will prove this claim by the following:
Let $r>r'>0$ and $x\in J$, then $J\cap I(x,r')\subset J\cap I(x,r)$. This means that $osc(f,x,r)\geq$ $osc(f,x,r')$ since $osc(f,x,r)$ is defined to be the supremum over the set $\{d(f(x),f(y)): x,y\in J\cap I(x,r)\}$. But any $x,y\in J\cap I(x,r')$ must also be in $J\cap I(x,r)$. Thus, $osc(f,x,r)$ cannot increase as $r$ is made smaller. If $osc(f,x)\geq \epsilon$, It cannot be that for "really small" $r>0$ that $osc(f,x,r)<\epsilon$. Because then the limit cannot be $\geq \epsilon$. This proves the Claim.
Now, given any $r>0$, either $(x-\frac{r}{2},x)\subset J\cap I(x,r)$ or $(x,x+\frac{r}{2})\subset J\cap I(x,r)$, or both. WLOG, suppose $(x-\frac{r}{2},x)\subset J\cap I(x,r)$ and denote it as $I$. Then $\exists N\in \mathbb{N}$ such that for all $n\geq N,$ it follows that $x_n\in I$. As $I$ is open, we can choose $\varrho'$ sufficiently small such that $B_{\varrho'}(x_n)\subset I$. Set $\rho=max\{\varrho, \varrho'\}$. Then \begin{equation*} osc(f,x,r)\geq osc(f,x_n,\rho)\geq \epsilon \end{equation*} Since we choose $N$ and $\rho$ for any given $r>0$, it follows that $osc(f,x)\geq \epsilon$ and $x\in D_\epsilon$. This completes our proof.
Any corrections of the proof or comments on style are very much appreciated. Thank you guys for your time.
Your proof is ok, but maybe it's easier to show that the complement,
$D^c_\epsilon=\{x\in J: osc(f,x)< \epsilon\},$ is open.
If $x\in D^c_\epsilon$, there is a $\delta>0$ such that $\sup\{|f(z)-f(w)|:z,w\in (x-\delta,x+\delta)\}<\epsilon.$
Now suppose $y\in (x-\delta/3,x+\delta/3)$. Then, $B(y):=(y-\delta/2,y+\delta/2)\subseteq (x-\delta,x+\delta)$, so that $|f(z)-f(y)|<\epsilon$ as soon as $z\in B(y).$ From this it follows that $osc(f,y)<\epsilon$ and therefore, that $y\in D_{\epsilon}^c$.
Thus, we have found a ball about $x$, namely $ (x-\delta/3,x+\delta/3)$ which is contained in $D_{\epsilon}^c,$ and so $D_{\epsilon}^c$ is open.