Difficulties understanding a solution of a real analysis problem

I was working on some problems on Integration part of the book Problems in Mathematical Analysis by Kaczor and Nowak. And it seems that I don't get this one solution.

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!

• If one of those points is equal to an $x_i$ it will be counted in $[x_{i-1},x_i]$ as well as $[x_i,x_{i+1}]$. Oct 17 '18 at 8:10
• You're right .Thank you very much, and what about the second sentence? Oct 17 '18 at 8:19

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.$$