How do I prove that a function with a finite number of discontinuities is Riemann integrable over some interval?

First, I want to figure out why, for the simple case where $ g:[a,b]\rightarrow\mathbb{R} $ is bounded and continuous except at some point $ x_0\in[a,b], $ $ g$ is Riemann integrable on [a,b].

I know the Riemann integrability condition that there must exist some partition $ P $ for which $ U(P,f) – L(P,f)\leq\epsilon, \forall \epsilon>0 $.

For my attempt at a proof, I said:

Let $ P=\{x_0,x_1,\cdots,x_n:x_0=a<x_1<\cdots<x_n=b\} $ be a partition of $ [a,b] $. Let $ x_0\in[x_{k-1},x_k]. $ Then normally for an everywhere continuous function, since $ [a,b] $ is a compact set, the function is uniformly continuous and therefore $ \exists\delta(\epsilon):|x-y|<\delta\implies|f(x)-f(y)|<\epsilon,\forall\epsilon>0 $. Using this, we can make any of the subintervals in the partition arbitrarily small, and eventually make the difference between the upper and lower sums arbitrarily small by using the property that a continuous function will attain its maximum and minimum. But how do I do something similar for $ g $? Furthermore, how can I extend that to the case in which $ g $ is discontinuous at $ x_0, x_1, \cdots, x_n $?

EDIT: Using ncmathsadist’s advice,

Let $\epsilon > 0$. Let $M = \sup_{x\in[a,b]} f$.

Let $ D=\{x_0,x_1,\cdots,x_{2n}:x_0<x_1<\cdots<x_{2n}\} $ be a subpartition containing all the points $ x_0,x_1,\cdots,x_n $ where $ g $ is discontinuous, such that $ \sum_{i=1}^{2n}(x_i-x_{i-1}) < \frac{\epsilon}{2M}$

Let $ C $ be a subpartition containing all the other points. By visiting the proof that a continuous function is Riemann integrable, I can construct a $ C $ so that:

$ U(C\bigcup D,f)-L(C\bigcup D,f)< \frac{\epsilon}{2M}\times M+\frac{\epsilon}{2}=\epsilon $

This is because $ g $ is bounded, and any contribution by $ g $ to the sum from the discontinuous point must be less than the maximum, $ M $.

Solutions Collecting From Web of "How do I prove that a function with a finite number of discontinuities is Riemann integrable over some interval?"

Let $\epsilon > 0$. Put $M = \sup_{x\in[a,b]} f$. Now choose a partition so that the total length of the intervals containing the discontnuities of $f$ is smaller than $\epsilon/2M$. The contribution from the intervals with discontinuities of $f$ is smaller than $\epsilon/2$. Since $f$ is continuous on the rest, it is fairly easy to engineer an argument that supplies a partition whose upper and lower sums differ by less than $\epsilon/2$.

Assemble the pieces and you have Riemann integrability.

$f$ is bounded $\Rightarrow \exists M \in R$ such that $f<|M|$. For all $\varepsilon>0$ :

Is $D=\{d_0,…,d_k\}$ the set of discontinuous points of $f$ and $P=\{x_0,…,x_n\}$ partition of $[a,b]$ containing $D$ such that:

  • the sum of intervals determined by $P$ such that one of the points is of discontinuous of $f$ is $\sum_{D}^{}(x_{i}-x_{j})<\frac{\varepsilon}{4M}$
  • $K=\{k_0,…,k_j\}$ is the set of other points of $P$ such that $\sum_{i=1}^j (M_i-m_i) (k_{i}-k_{i-1})<\frac{\varepsilon}{2}$ (in this points $f$ is continuous and we can make this choice).

So:
$$
U(f, K \cup D)-L(f,K \cup D)=\sum_{i=1}^j (M_i-m_i) (k_{i}-k_{i-1})+\sum_{D}^{} (M_i-m_i) (x_{i}-x_{j})
$$
$$
<\sum_{i=1}^j (M_i-m_i) (k_{i}-k_{i-1})+2M \sum_{i=1}^j (y_{i}-y_{i-1})<\sum_{i=1}^j (M_i-m_i) (k_{i}-k_{i-1})+2M \frac{\varepsilon}{4M}
$$

$$
=\sum_{i=1}^n (M_i-m_i) (k_{i}-k_{i-1})+\frac{\varepsilon}{2} <\frac{\varepsilon}{2}+\frac{\varepsilon}{2} < \varepsilon
$$

From that: $f$ is Darboux Integrable, consequently Riemann Integrable (and Cauchy Integrable)