Can a function that has uncountable many points of discontinuity be integrable?

First of all, I would like to show you how we defined Riemann-integrals and Lebesgue-integrals to make sure that we are talking about the same:

Riemann-intregrability

Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a function.

$$O(Z):=\sum_{k=1}^n(x_k-x_{k-1})\cdot\sup_{x_{k-1}<x<x_k}f(x)$$ $$U(Z):=\sum_{k=1}^n(x_k-x_{k-1})\cdot\inf_{x_{k-1}<x<x_k}f(x)$$

$$\overline{\int_a^b}f(x)\,\mathrm dx:=\inf_ZO(Z) := \inf \{ O(Z) : Z \mbox{ is a segmentation of } [a,b] \}$$ $$\underline{\int_a^b}f(x)\,\mathrm dx:=\sup_ZU(Z):= \sup \{ U(Z) : Z \mbox{ is a segmentation of } [a,b] \}$$

$f$ is called Riemann-integrable over $[a, b] \subset \mathbb{R} :\Leftrightarrow \underline{\int_a^b}f(x)\,\mathrm dx=\overline{\int_a^b}f(x)\,\mathrm dx$

This is the image that we had in mind when we introduced the Riemann-integral:

enter image description here

Lebesgue-integrability

Let $\emptyset \neq X \in \mathfrak{B}_d$ be and $f:X \rightarrow [0;\infty)$ be a simple function with normal form $f=\sum_{j=1}^m y_j \mathbb{1}_{A_j}$. The Lebesgue-integral is defined as

$$\int_X f(x) dx := \sum_{j=1}^m y_j \lambda_d(A_j)$$

My question

Does any function with uncountably infinte many points of discontinuity exist, that is Riemann-integrable / Lebesgue-integrable? If not, why?

Related

The following function has a countably infinite number of points of discontinuity and it is Riemann-integrable (source):

$f:[0,1] \rightarrow \mathbb{R}$ which is defined as

$$f(x)=\begin{cases} 1& \text{ if } \exists n \in \mathbb{N}: x=\frac{1}{n}\\ 0& \text{ otherwise} \end{cases}$$

And $\int_0^1 f(x) \mathrm{d}x = 0$


The indicator function (characteristic function) of the middle-thirds Cantor set $C$ is both Riemann and Lebesgue integrable (with integral $0$) and is discontinuous at each point of $C$.


Let $C$ be the cantor set. Define $f:R\rightarrow\{0,1\}$, such that $f(x)=1$ if $x\in C$ otherwise let $f(x)=0$ . Since $C$ is measurable, it follows that $f(x)$ is measurable. since $f(x)$ is bounded by $\chi_{[0,1]}$, therefore $f$ is integrable. Finally, it is easy to verify that $f(x)$ is discontinuous at every $x\in C$


Lebesgue's Theorem states that a function is Riemann-integrable if and only if it is continuous almost everywhere (ie, outside a set of measure $0$). Brian and Amr's answer simply notes that the Cantor set $C$ is an uncountable set with measure $0$, and its characteristic function is precicely at the points in $C$ (since a point outside of $C$ is, by construction, contained in an open interval in the complement of $C$, and any two points in $C$ are separated by a point in the complement). You should be able to verify by hand (ie, without the theorem) that this function really is Riemann integrable.