The sentences underlined with red are unclear to me.If there are $k_N$ rationals then how is it possible to be $2k_N$ subintervals containing at least one of those rationals.Any help would be appreciated. Thank you!
Notice that $f$ is nonnegative and in fact by density of real number, $0$ is attained in any interval of positive length.
For those intervals that do not contain of those rational value of which we have $q \le N$. We have $q > N$ and hence $\frac1q < \frac1N$. That is $M_j < \frac1N$ and $m_j = 0$. Hence $$M_j - m_j < \frac1N.$$