Consider the following function on $[0,1]$: $$f(x)=\begin{cases}1&x\in\{a_1,a_2,\dots,a_n\}\\0 &\text{otherwise}\end{cases}$$ The $a_i$ are fixed and all in $[0,1]$. Determine whether $f$ is Riemintegrable or not.
By the Riemann–Lebesgue criterion $f$ is Riemann integrable. How to prove directly?