An example of discontinuous integrable function "Let $f(x)=1$ if $x=1,1/2,1/3,1/4,...$ and $f(x)=0$ elsewhere.
Prove that $f$ is integrable on $[0,1]$. What is the value of that integral?"
I'm guessing the value to be $0$, intuitively.
I know the lower integral is zero. But I can't prove the same about the upper integral because I can't find the appropriate partition.
Part of me says its not integrable but not sure about that.
 A: Let $k\in\mathbb N$ and $\epsilon=\frac1{k}>0$.  Then all but finitely many of the points of discontinuity are in $[0,\epsilon]$.  All but $k-1$ points to be exact.  Suppose $x_1,\dots,x_{k-1}$ are the points of discontinuity outside that interval (in order).  Note that $x_{k-1}=1$.  Now take the partition
$$0,\ \epsilon,\ x_1-\frac{\epsilon}{k},\ x_1+\frac{\epsilon}{k},\ \dots,\ x_{k-2}-\frac{\epsilon}{k},\ x_{k-2}+\frac{\epsilon}{k},\ 1-\frac{\epsilon}{k},\ 1$$
The upper sum is equal to $$\epsilon + \left((k-2)\frac{2\epsilon}{k}\right)+\frac{\epsilon}{k}=\frac{1}{k}+\frac{2k-3}{k^2}$$  This goes to zero as $k\rightarrow\infty$.  And the lower sum is zero.  So the difference of upper sum and lower sum for this sequence of partitions goes to zero.  So the function is Riemann integrable.  And since the sums converge to zero, $\int_0^1f=0$.
A: Use can use the fact that That the function is bounded on a closed interval to get that it is Riemann integrable and also Lebesgue integrable. The Lebesgue integral is $0$ and therefore the same for Riemann.
