# $f$ is Riemann integrable if the set of discontinuities is measure zero.

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$$.

(a) For every $$\epsilon>0$$, the set of points $$c$$ in J such that $$osc(f,c)\geq \epsilon$$ is compact.

(b) If the set of discontinuities of $$f$$ has measure $$0$$, then $$f$$ is Riemann integrable.

I've already proved part (a) so this is my attempt at part (b)

My proof attempt:

Proof. Fix $$\epsilon>0$$. Define $$\begin{equation*} D_\epsilon=\{c\in J: osc(f,c)>\epsilon\} \end{equation*}$$ Then $$D_\epsilon$$ is the set of discontinuities of $$f$$. By hypothesis, $$D_\epsilon$$ is measure zero. We will prove that $$f$$ is Riemann integrable by showing that there exists a partition $$P$$ such that $$|U(P,f)-L(P,f)|<\epsilon$$, where $$U(P,f)$$ and $$L(P,f)$$ are the upper and lower sums of $$f$$ over partition $$P$$, respectively.

By Observation 3 of the Exterior Measure in Stein, there exists an open set $$\mathcal{O}$$ such that $$D_\epsilon\subset \mathcal{O}$$ and $$m(\mathcal{O})\leq \epsilon.$$ By theorem 1.3, $$\mathcal{O}$$ can be written as a disjoint countable union of open intervals $$(I_j)_j$$. By Part (a), $$D_\epsilon$$ is compact. Since $$(I_j)_j$$ covers $$D_\epsilon$$, we need only a finite sub-cover to cover $$D_\epsilon$$, say $$(I_j)^{k}_{1},$$ and denote the collection as $$\mathcal{F}$$. Then $$\begin{equation*} m(D_\epsilon)\leq m(\underset{I\in \mathcal{F}}{\bigcup}I)\leq m(\mathcal{O})\leq \epsilon \end{equation*}$$ Hence, we now have a finite cover of $$D_\epsilon$$ whose "total length" is $$\leq \epsilon$$.

Since $$J$$ is closed and $$I\in \mathcal{F}$$ is open, it follows that $$J\setminus \underset{I\in \mathcal{F}}{\bigcup}I$$ is closed. Since $$J\setminus \underset{I\in \mathcal{F}}{\bigcup}I\subset J$$, it is also compact. Any continuous $$f$$ over a compact interval is uniformly continuous. Therefore, there exists $$\delta>0$$ such that for all $$x,y\in J\setminus \underset{I\in \mathcal{F}}{\bigcup}I$$ satisfying $$\begin{equation*} |x-y|<\delta \implies |f(x)-f(y)|<\epsilon. \end{equation*}$$ Let $$P_1$$ be a partition of $$J$$ such that every pair of consecutive points is within $$\delta$$ of each other, e.g. one way of constructing such a set is to partition $$J$$ into $$\frac{|J|}{2^n}$$ length intervals for large enough $$n\in \mathbb{N}$$. Now define $$\hat{P}_1$$ to be a partition of $$J$$ such that $$\begin{equation*} \hat{P}_1=P_1\setminus \{x\in P_1: x\in \underset{I\in \mathcal{F}}{\bigcup}I\}. \end{equation*}$$ Next, define $$P_2$$ to be a partition of $$J$$ such that $$P_2$$ is the set of the end points of $$I_1, I_2,...,I_k$$, and $$J$$. Finally, let $$P$$ be the common refinement of $$P_1$$ and $$P_2$$, i.e. $$P=P_1\cup P_2$$. We will now show that $$P$$ is the desired partition of $$J$$.

Enumerate the points of $$P$$ as $$x_1,x_2,...,x_N$$. Denote $$\Delta x_i=|x_{i+1}-x_i|$$ for $$i=1,...,N-1$$. Denote as well the interval $$[x_{i+1},x_i]$$ as $$\nabla x_i.$$ If two consecutive points in $$P$$ are also in $$P_2$$, denote the length instead by $$\Delta y_i$$. Moreover, for each $$\Delta x_i$$, let $$m_i$$ and $$M_i$$ be the infimum and supremum of $$f$$ over $$\nabla x_i$$, respectively. Define $$$$C:=2\cdot \sup\{|f(x)|:x\in J\}<\infty \quad \text{ Since f is bounded.}$$$$ Finally, observe \begin{align*} |U(P,f)-L(P,f)|&=|\underset{x_i\in P}{\sum} M_i\Delta x_i- \underset{x_i\in P}{\sum} m_i\Delta x_i| \\ &=|\underset{x_i\in P}{\sum} (M_i-m_i)\Delta x_i| \\ &=|\underset{x_i\in P_1}{\sum} (M_i-m_i)\Delta x_i + \underset{x_i\in P_2}{\sum} (M_i-m_i)\Delta y_i| \\ &\leq \underset{x_i\in P_1}{\sum} |(M_i-m_i)|\Delta x_i + \underset{x_i\in P_2}{\sum} |(M_i-m_i)|\Delta y_i \\ &\leq \epsilon|J| + C\epsilon \\ &\text{ By Uniform Continuity of f over J\setminus \underset{I\in \mathcal{F}}{\bigcup}I} \\ &=\epsilon(|J|+C) \\ \end{align*} As niether $$|J|$$ nor $$C$$ depend on $$\epsilon$$, this completes our proof.

The definition of the Riemann Integrable I use is from Rudin's PMA. Any corrections of the proof or comments on style are highly appreciated.

I recognize the proof is really long and I appreciate the time of anybody who parses through it.