# Is this function equal almost everywhere to a Riemann integrable function?

Let $$(a_n)_{n=1}^{\infty}$$ be an enumeration of $$\mathbb{Q} \cap [0,1]$$. Define $$B_n := \left\{x \in [0,1] : x \in \left( a_n \pm \frac{1}{2 \cdot 3^n}\right)\right\}$$, $$C := \bigcup_{n=1}^{\infty}B_n$$.

Since $$\mu(B_1) \geq 1/6$$ and $$\sum_{n=1}^{\infty}\mu(B_n) \leq 1/2$$, the indicator $$\chi_C$$ integrates to some value between $$1/6$$ and $$1/2$$ using the Lebesgue integral. Since each set in a partition of $$[0,1]$$ will contain some values $$x$$ with $$\chi_C(x) = 1$$, all upper Darboux sums of $$\chi_C$$ are 1, and so $$\chi_C$$ isn't Riemann integrable.

My question: Does there exist some $$f : [0,1] \to \mathbb{R}$$ with $$f = \chi_C$$ almost everywhere such that $$f$$ is Riemann integrable?

I believe the answer is no, and my thinking is along these lines:

I assume you're familiar with the result that Riemann-integrable functions are precisely those that are continuous almost-everywhere. So take $$E \subseteq [0, 1]$$ to be the set of points where $$f$$ is continuous.

Since $$f = \chi_C$$ a.e., we can say that $$f = \chi_C$$ on a set $$F$$ of full measure. Then the restriction of $$\chi_C$$, considered as a function on the set $$E \cap F$$, is continuous.

It follows that no point in the set $$C^c \cap E \cap F$$ can be the limit of points from $$C \cap E \cap F$$, or else continuity would fail. (Because $$0 < \lambda(C) < 1$$, and $$E \cap F$$ has full measure, both $$C^c \cap E \cap F$$ and $$C \cap E \cap F$$ are nonempty.)

However, note that $$C$$ is a dense open set in $$[0, 1]$$, and you can verify that the intersection of a dense open set and a set of full-measure is still dense. So $$\overline{C \cap E \cap F} = [0, 1]$$, the aforementioned property fails, and it seems that no such $$f$$ exists.

(I typed this up in a rush and late at night; please let me know if you think there are any mistakes.)

• Excellent. If I understood you correctly, the argument is that $C \cap E \cap F$ contains all its limit points, i.e., is its own closure, contradicting the fact that the closure of $C \cap E \cap F = [0,1]$. Commented Nov 8, 2023 at 11:41