I would appreciate some help with the following exercise:
Let
$$f(x)=\begin{cases} 1 & \text{if}\ x= 1/n\ \text{for some}\ n \in \mathbb{N} \\ 0 & \text{otherwise} \end{cases}$$
Show that $f$ is integrable in $[0,1]$ and compute $\int_{0}^1 f$.
Now, the lower sum is $0$ for every partition $P$, as every interval contains points where $f(x)=0$. It then remains to show that the upper sum is also $0$.
This is the part I do not know how to handle. The phrasing of the exercise baffles me as it seems to me that there is an infinite number of discontinuities, .i.e. points where $f(x)=1$, and I have only encountered instances with finite discontinuities.
Thank you in advance.
Hint: The key here is to notice that, given $\varepsilon > 0$, you can cover up the points $1/n$ with finitely many intervals such that the sum of the "widths" of these intervals is at most $\varepsilon$.