Is the following argument correct ?
Proposition. Let $\mathcal{B}$ be the collection of all open intervals $(a,b)$ in $\mathbf{R}$ with $a<b$ and $a$ and $b$ are rationals. Prove that $\mathcal{B}$ is a basis for the euclidean topology on $\mathbf{R}$.
Proof. Let $\mathcal{A}$ be the collection of all open intervals $(x,y)$ where $x,y\in\mathbf{R}$, since we know beforehand that $\mathcal{A}$ is a basis for $\mathbf{R}$, consequently given an arbitrary open set $O$ in $\mathbf{R}$, we have, for some indexed subset $J$ of $\mathcal{A}$.
$$O = \bigcup_{j\in J}(a_j,b_j)$$
Now let $j\in J$. We show that $(a_j,b_j)$ can be written as a union of intervals found in $\mathcal{B}$. We begin by defining sequences $\{x_n\}_{n=0}^{\infty}$ and $\{y_n\}_{n=0}^{\infty}$ as follows $$x_0 = y_0 = \frac{a_j+b_j}{2}$$ $$x_{n+1} = \frac{a_j+x_n}{2}\ \text{ and }\ \ y_{n+1} = \frac{y_n+b_j}{2}$$
Given thh definition of the above sequences it is evident that $\{x_n\}_{n=0}^{\infty}$ is monotonically decreasing and bounded below by $a$ and $\{y_n\}_{n=0}^{\infty}$ is monotonically increasing and bounded above by $b$ consequently the converge with the limits in question being
$$r_1 = \lim_{n\to\infty}x_{n+1} = \frac{a_j+\lim_{n\to\infty}x_n}{2} = \frac{a_j+r_1}{2}$$ $$r_2 = \lim_{n\to\infty}y_{n+1} = \frac{\lim_{n\to\infty}y_n+b_j}{2} = \frac{r_2+b_j}{2}$$ which imply that $r_1=a_j$ and $r_2 = b_j$, given this the following inferences are immediate (for the following sequences $n\ge 1$). $$\lim_{n\to\infty}x_{2n} = a_j \ \ \ \ \lim_{n\to\infty}x_{2n-1} = a_j\ \ \ \ \lim_{n\to\infty}y_{2n} = b_j \ \ \ \ \lim_{n\to\infty}y_{2n-1} = b_j$$ Now given the density of $\mathbf{Q}$ in $\mathbf{R}$ we have sequences of rationals $\{p_n\}_{n=1}^{\infty}$ and $\{q_n\}_{n=1}^{\infty}$ such that $x_{2n}<p_n<x_{2n-1}$ and $y_{2n}<q_n<y_{2n-1},\forall n\ge 1$, the squeeze theorem then yields that $$\lim_{n\to\infty}p_n = a_j$$ $$\lim_{n\to\infty}q_n = b_j$$ consequently $$(a_j,b_j) = (p_1,q_1)\cup\bigcup_{n=1}^{\infty}(p_n,x_0)\cup(y_0,q_n)$$ the claim in question is then evident.
$\blacksquare$
No, it is not correct, since you have no reason to suppose that $x_0,y_0\in\mathbf Q$. So, your last expression is not necessarily an union of elements of $\mathcal B$.
Given an interval $(a,b)$ of real numbers, you could simply take a decreasing sequnce $(x_n)_{n\in\mathbb N}$ of elements of $\left(a,\frac{a+b}2\right)\cap\mathbf Q$ and an increasing sequence $(y_n)_{n\in\mathbb N}$ of elements of $\left(\frac{a+b}2,b\right)\cap\mathbf Q$ such that $\lim_{n\to\infty}x_n=a$ and that $\lim_{n\to\infty}y_n=b$. Then$$(a,b)=\bigcup_{n=1}^\infty(x_n,y_n)$$and each $(x_n,y_n)$ belongs to $\mathcal B$.