Suppose $A = \{a_n\}_1^\infty$ is a sequence of real numbers converging to $0$, and $B = \{b_1, b_2, b_3,...\}$ is a countably infinite subset of the interval $[0,1]$. Consider the function $f$ on $[0,1]$ where \begin{equation*} f(x) = \begin{cases} \hfill a_n \hfill & \text{ if $x = b_n$} \\ \hfill 0 \hfill & \text{ if $x \notin B$} \\ \end{cases} \end{equation*} Prove $f$ is Riemann integrable and determine $\int_0^1 f(x)dx$.
I've seen explanations of this for Thomae's function, which is very similar. In this case, since we are told $B$ is a countable set (and $B$ is the set of discontinuities) we have by Lebesgue's Criterion that $f$ is Riemann integrable.
My intuition tells me that the value of the integral should be zero (the same as the integral of Thomae's function), but I'm unsure how to formally prove this.