TITLE: An example of a sequence of Riemann integrable functions $(f_n)$ that converges pointwise to a function $f$ that is not Riemann integrable.
QUESTION [5 upvotes]: I have been given the example
$$
f_n(x)=
\begin{cases}
1, & \text{if}\; x\in\{(x_k)_{k=1}^{n}\}, \\
0, & \text{otherwise.}
\end{cases}
$$
Here the sequence $(x_k)_{k=1}^{\infty}$ is the sequence that "enumerates" elements of $\mathbb{Q}$. The sequence of functions converges pointwise to
$$
f(x)=
\begin{cases}
1, & x\in\mathbb{Q}, \\
0, & x\notin\mathbb{Q},
\end{cases}
$$
which isn't Riemann integrable. However, I am not quite convinced that $f_n$ is integrable. I would like some help in seeing how $f_n$ is Riemann integrable. Also, I would like more examples of sequences of Riemann integrable functions $f_n$  that converge pointwise to a function $f$ that is not Riemann integrable.

REPLY [3 votes]: For the $f_n(x)$, it comes down to the fact that the Riemann sum $1dx \rightarrow 0$ when the partition width is small-enough. Then you do this finitely-many times, and you get a total of $0$ for any $f_n(x)$. You can show that this result is true no matter how small you make the partition width $||P||$, i.e., you can show $|\Sigma f(x)dx-0 |<\epsilon$ for any partition width.