The statement is not correct. The set of all irational numbers is a counterexample. What the proof in the OP proves is that every open set is a disjoint union of countably many open intervals. That statement and the proof are correct.
Update 1: I looked at the proof again and I think that the objections by OP are valid. The proof is wrong. Indeed, it is so not only because we may not cover all irrational points in $U$ but also not all rational points there: it could happen that the rational point we are trying to cover is a limit point of the already covered set. In that case the "maximal interval" does not exist.
Update 2: It looks like the answers and comments here contain a correct proof:
Any open subset of $\Bbb R$ is a countable union of disjoint open intervals
Update 3: The proof in OP can be saved if one takes each time the maximal interval $(p_n-a, p_n +b)$ contained in $U$. That interval cannot intersect with any of the previously chosen intervals because those were maximal too. This way we cover all rational points. Then if we take an irrational point, its maximal interval must contain one of the $p_n$, so it must belong to the maximal interval of the $p_n$ and so that point is also covered.