In the book of Analysis on Manifolds by Munkres, at page 96, in the proof of the theorem stating that a bounded function over a rectangle $Q$ is integrable iff the set of discontinuities of $f$ over $Q$ has measure zero, it is argued that
However, how do we know that there exists at most countably many such rectangle $R$ so that their union has also measure zero ?
Similarly how do we know that there is only a finite number of $R$s that contains the points of $D_m ''$ ?



"However, how do we know that there exists at most countably many such rectangle $R$ so that their union has also measure zero ?"
Each Bd $R$ has measure $0.$ There are only finitely many $R.$ Thus the union of all of these has measure $0.$ No claim is being made about a union of rectangles having measure $0.$ (I am confused about what you are calling $R,$ which should throughout the proof denote a subrectangle coming from the partition $P.$)
"Similarly how do we know that there is only a finite number of $R$s that contains the points of $D_m ''$ ?"
Because there are only finitely many $R$s to begin with; they are determined by the partition $P.$