= Solution
Assume $a_n\to0$. The function is bounded, and every interval has lower <Darboux sum> zero because it contains an irrational. Given $\varepsilon>0$, choose $N$ so that $a_n<\varepsilon/2$ for $n>N$. Put small intervals around the finitely many points $q_1,\ldots,q_N$ whose total length makes their contribution to the upper sum less than $\varepsilon/2$, and refine their endpoints to a partition. On every remaining subinterval the function is at most $\varepsilon/2$, so the upper sum is less than $\varepsilon$. The <Riemann integrability criterion> proves that \b[$f$ is Riemann integrable with integral zero].
The condition $a_n\to0$ is sufficient but not necessary. Assign $a_n=1$ when $q_n=1/k$ for some positive integer $k$, and $a_n=1/n$ otherwise. Then $(a_n)$ does not tend to zero. Outside a short interval near zero only finitely many unit spikes occur and can be enclosed in intervals of arbitrarily small total length; all remaining values can be made uniformly small except for finitely many further points. The same Darboux-sum argument proves that this $f$ is Riemann integrable with integral zero.
Back to article page