We have $(r_k),k\geq1$ as an enumeration for the rationals in $[0,1)$ and $f$ is a function defined as $$\large f=\sum_{k\geq 1}\frac{1}{k^2}\mathbf{1}_{[0,r_k)}$$ where $\mathbf{1}$ is the indicator function. Show that $f$ is Riemann integrable
I would like to do this using the condition where we find a sequence of step-functions $(\phi_n)$ such that
$$\sup\lvert f-\phi_n\rvert\to0,\;n\to\infty.$$
I have though of defining $\phi_n$ on a partition $P_n=\{\frac{m}{n}:m=0,1,...,n\}$ enumerated ascendingly as $x_m$
defining
$$\phi_n(x)=f(x_m),\forall x\in(x_{m-1},x_m).$$
This gives
$\sup\lvert f-\phi_n\rvert=\sup_{0\lt m\leq n}\lvert f(x_{m-1})-f(x_m)\rvert$ as $f$ is increasing but I do not know where to go from here.
Any hints would be great!
Step I. Fix $\epsilon$ and let $N$ be large enough so that a. $1/k^2 > \epsilon$ only if $k\le N$; b. $\sum_{k>N} \frac{1}{k^2} < \epsilon$.
Step II. Now partition $[a,b]$ to $a=p_1<p_2 <\dots <p_L=b$ in such a way such that each of the elements $r_1,\dots,r_N$ is in the interior of exactly one partition interval $[p_t,p_{t+1}]$ (special attention if $r_j$ is one of the endpoints $a$,$b$, details of which I'll leave), and that the total length of all of the corresponding $N$ partition intervals is $<\epsilon$. Label these $N$ partition intervals by $I_1,\dots, I_N$. The last condition can be written as $\sum_{j} |I_j| < \epsilon$. Label all remaining closed intervals $[p_t,p_{t+1}]$ from the partition by $J_1,\dots, J_M$.
Step III. Note that $\sup_{x} f(x)<2$. Now for each of the intervals $I_1,\dots,I_N$ we have $\sup_{x \in I_j} f(x) - \inf_{x\in I_j} f(x) \le \sup_{x} f(x) <2$, and for each of the remaining intervals we have $\sup_{x\in J_j} f(x) - \inf_{x\in J_j} f(x)\le \epsilon$.
Step IV. Use the bounds above to conclude that the difference between the upper Riemann sum and the lower Riemann sum is bounded above by $2 \sum_{j} |I_j| + \epsilon \sum_{j} J_j \le 2 \epsilon + \epsilon (b-a)$. As $\epsilon$ is arbitrary, we conclude that the function is Riemann integrable.
Hope this helps.