# Proving $f$ is not Riemann integrable but is Lesbesgue with definition involving simple step functions

I am familiar with the proof of showing that $f:[0,1]\to\mathbb{R}$, where $$f(x)=\begin{cases} 0 & \text{if} \, \, x\in\mathbb{R}\setminus\mathbb{Q} \\ 1 & \text{if} \, \, x \in \mathbb{Q} \end{cases}$$ is not Riemann integrable with the traditional definition of Riemann integration with Darboux sums and partitions of intervals, etc. However, I want to show the same result with an alternative definition. Additionally, I want to show that it is Lesbesgue integral using a particular definition as well.

Definition: A function $f$ is said to be Riemann integrable if for all $\epsilon>0$ there exists simple step functions $g,h$ such that $g \leq f \leq h$ and $\int h - g < \epsilon.$

Definition: By a simple step function we mean a finite linear combination of characteristic functions on semi-open intervals, i.e. if $s$ is a simple function then: $$s:=\lambda_1 \chi_{I_{1}} + \dots + \lambda_n \chi_{I_{n}}$$ where $\lambda_j$ are scalars and $I_j$ are semi-open intervals for $1 \leq j \leq n$.

Definition: A real valued function $f$ defined on $\mathbb{R}^n$ is said to be Lesbesgue integrable if there exists a sequence of simple step functions, $(f_n)$ such that the following two conditions are satisfied:

a) $\quad \displaystyle\sum_{n=1}^{\infty} \int |f_n| < \infty$

b) $\quad f(x)=\displaystyle\sum_{n=1}^\infty f_n(x) \quad \forall x \in\mathbb{R}^n$ such that $\displaystyle\sum_{n=1}^{\infty} |f_n| < \infty.$

Then, the integral of $f$ is defined to be: $$\int f = \sum_{n=1}^{\infty} \int f_n.$$

I'm not sure how to show the result with this definition, but I'm thinking of going about it by contradiction, suppose $f$ is Riemann integrable, then there are two simple step functions $g$ and $h$ such that $g \leq f \leq h$. Then, maybe we could choose a sequence $(g_n)$ and $(h_n)$ such that $g_n \to g$ and take subsequences such that each $g_n \in \mathbb{Q}$ for all $n$, and similarly $h_n \to h$ and take subsequences such that each $h_n \in \mathbb{R}\setminus\mathbb{Q}$, for all $n$, so $\int h - g = 1$, which is not less than $\epsilon$ for all $\epsilon>0$. This doesn't quite feel right though.

Then, as far as showing that it is Lesbesgue integable with this definition, I am thinking about enumerating a sequence of rational numbers $\left\{ q_1 , q_2 , \dots \right\}$ such that $f_n = q_n$ and using that but as my simple functions, but I'm having trouble formalizing it with this definition.

As to the first part, since any interval contains both rational and irrational points, a simple step function $\ge f$ must be $\ge 1$ everywhere on $I=[0,1]$, and a simple step function $\le f$ must be $\le 0$ everywhere on $I.$

I thought I had the second part solved, but just as I finished typing my answer, I saw that it was wrong or at least incomplete. I'm going to post it anyway, because it's very close, and I think you can finish it.

It's enough to find for each $q\in I\cap \mathbb Q,$ a sequence of simple step functions $f_{q,n}$ such that $$\sum_{n=1}^{\infty}{f_{q,n}(x)}= \begin{cases} \infty, &x=q\\ 0,&x\in I\setminus\mathbb Q \end{cases}$$ I haven't specified the value of the sum at rationals in $I$ other than $q$. It's going to be $\le 0$ at such points. The difficulty I'm having is arranging that for any $x\in I$ there are only finitely many $q$ such that $\exists n, f_{q,n}(x)< 0.$ It will be clear from the construction that for any $q$ there is at most one such $n$.

Since the countable union of countable sets is countable, we can arrange the $f_n,q$ into a sequence $f_n$ with the required property: $$\sum_{n=1}^{\infty}{f_n(x)}= \begin{cases} \infty, &x\in I\cap \mathbb Q\\ 0,&x\in I\setminus\mathbb Q \end{cases}$$ To construct $f_{n,q}$ for a given $q\in I\cap\mathbb Q,$ choose a strictly decreasing sequence of rational numbers $\varepsilon_n \rightarrow 0$ such that $[q,q+\varepsilon_n)\subset I, n=1,2,3\dots.$ Now for $n=1,2,3\dots,$ define $$f_{q,2n-1}=n\chi_{[q,q+\varepsilon_n)},\\ f_{q,2n}=-n\chi_{(q,q+\varepsilon_n]}$$

If it weren't for the "semi-open interval" requirement, we could make the interval in the definition of $f_{q,2n}$ equal to $(q,q+\varepsilon_n)$ and we'd be done. Now it seems as if we have to somehow control the $\varepsilon_n$ (which depend on $q,$ remember) so that no point occurs as an upper endpoint of the interval more than finitely many times.

This seems straightforward, but I haven't worked out all the details. Arrange the elements of $I\cap\mathbb Q$ in sequence: $q_1, q_2, \dots.$ There's no problem finding suitable $\varepsilon_n$ for $q_1$. For $q_2$ choose a sequence $\varepsilon_n'\rightarrow 0.$ Since $q_1+\varepsilon_n\rightarrow q_1, q_2+\varepsilon_n'\rightarrow q_2,$ only finitely many of the $q_2+\varepsilon_n'$ can be in the sequence $q_1+\varepsilon_n,$ and we can simply delete the corresponding $\varepsilon_n'$ from the sequence. A similar arguments works for $q_k,$ because we have at most finitely many $\varepsilon$ to discard from each of the $k-1$ preceding sequences.

I think this is a sketch of a valid proof, but it needs to be cleaned up, obviously. The only other detail is that the argument doesn't work at $q=1,$ where there is no interval $[q,q+\varepsilon)\subset I,$ but a symmetric argument works.