Let $f(p/q)=1/q$ if fraction $p/q$ is in lowest terms and $f(x)=0$ for irrational $x$ and when $x=0$. Show it is integrable on $[0,1]$.
My idea: Construct a partition such that $U(p,f)-L(p,f) < \epsilon$. The lower sum should be 0. It suffice to show $U(p,f)< \epsilon$. Consider a interval $[p/q-\delta, p/q+\delta]$. The length and $sup \ f(x)$ of the interval are known.
And I know the number of such interval is finite. However, I do not know how to construct such interval so I do not know how many interval are there exactly.
Edit: As OP, I am the first to vote for close, as well as reopen. The reason for close is that the function is the same as the one in the link. However, the reason for reopen is that the definition of integration is slightly different, and I do not stuck in the same place as the OP in the link. In addition, it seems the answer does not address my question. So, I vote for reopen.