# Riemann integrable or not?

Let $(a_n)_1^\infty$ be an increasing sequence in $(0,1)$ with limit $1$ and define $f:[0,1]\to\mathbb{R}$ such that $f(x)=1$ if $x=a_n$ for some $n\in\mathbb{N}$ and $f(x)=0$ otherwise. Is $f$ Riemann integrable on $[0,1]$?

I think it is Riemann integrable since $f$ is bounded and has a countable number of discontinuities, namely the $a_n$'s. But I don't know how to rigorously show it.

Yes, it is integrable and its integral on $[0,1]$is $0$
Rigorous proof. $\blacktriangleleft$ Suppose $a_n$'s are mutually distinct [otherwise we could discard those terms with repeated values]. In other words $(a_n)$ is increasing strictly. Take $\varepsilon_0 = 1/2$, then for each $a_n \in [0,1]$, for all $\delta \colon 0< \delta <\min\{a_{n+1}-a_n, a_n - a_{n-1}\}$, there is $x = a_n+\delta/2 \in (a_n -\delta, a_n+ \delta)$ s.t. $$|f(x)-f(a_n)| =|0-1|=1 >1/2 =\varepsilon _0.$$Hence $f$ is not continuous at $a_n \blacktriangleright$.
Since the set $$\{a_n | n\in \mathbb{N}\}$$ is countable, it is of measure zero, and it is clear that this set is also the set of discontinuities of $f$ (see @xbh's answer), hence by Lebesgue criterion, $f$ is Riemann integrable on [0,1].