Let the length of an interval $I$ be $|I|.$
A subset $B\subset \mathbb{R}$ is called a null set if for any $\varepsilon>0,$ there exists a sequence of open intervals $(I_n)_{n\in\mathbb{N}}$ such that $B\subseteq\bigcup_{n\in\mathbb{N}}I_n$ and $\sum_{n\in\mathbb{N}}|I_n|<\varepsilon.$
A subset $A\subseteq\mathbb{R}$ is of first category if $A=\bigcup_{n\in\mathbb{N}}A_n$ where $A_n$ is nowhere dense set.
Oxtoby stated the following theorem:
Theorem: The real line $\mathbb{R}$ can be decomposed into two disjoint union of first category set $A$ and null set $B$.
Idea of Proof: Let $\mathbb{Q}=\{p_n:n\in\mathbb{N}\}.$ Fix $i,j\in\mathbb{N}.$ Let $I_{i,j}$ be intervals containing $p_n$ of length $1/2^{i+j}.$ Then $A=\bigcap_{j\in\mathbb{N}}\bigcup_{i\in\mathbb{N}}I_{i,j}$ is a null set while $B = \bigcup_{j\in\mathbb{N}}\bigcap_{i\in\mathbb{N}}I_{i,j}^c$ is of first category.
Question: What is an intuition behind the construction of $A$ and $B?$ When I tried to prove the theorem on my own, I would not know that $A$ and $B$ are constructed as above.
Any help is appreciated.
EDIT: According to Dave's comment, the decomposition is due to Lebesgue outer measure being $G_{\delta}.$ However, I think that there should be a more elementary way to construct the decomposition.
In particular, given that $\mathbb{R}$ can be decomposed into disjoint union of null set and set of first category, how do we construct them solely from their definitions?
This construction is actually quite natural. The idea is that you want to construct a set $A$ which is large in the sense of category but small in the sense of measure. As a start, you might try constructing a dense open set $A_\epsilon$ with small measure (say, measure at most something like $\epsilon$). How can you do this? Well, to make $A_\epsilon$ dense, you just need it to contain the rationals. Since the rationals are countable, you can get an open set containing them with small measure: just take an interval of length $\epsilon/2^n$ around $p_n$, and the total measure will be at most $\sum_n \epsilon/2^n=2\epsilon$.
Now this $A_\epsilon$ is not quite a null set. To get a null set, you can take an intersection of such sets $A_\epsilon$ as $\epsilon$ goes to $0$. That's exactly what your $A$ is: $\bigcup_{i\in\mathbb{N}}I_{i,j}$ is just $A_\epsilon$ for $\epsilon=1/2^j$, and $A$ is their intersection. Since it's a countable intersection, its complement $B$ still has first category.