It can be easily shown, using the definition of the product topology and the fact that $\mathbb R$ is connected, that both the horizontal and vertical lines in $\mathbb R^2$ are connected subspaces.
We also have the following result:
If the intersection of a family of connected subspaces is nonempty, then the union of those subspaces forms a connected subspace.
The above is all that is needed to wrap this up.
Let $A = \{ (x,y) \in \mathbb R^2 \; | \; x = 0 \text{ or } y = 0 \}$
So this is a connected space.
For $q \in \mathbb Q$, define
$\tag 1 S_q = A \, \bigcup \, (\{q\} \times \mathbb R)$
and
$\tag 2 T_q = A \, \bigcup \, (\mathbb R \times \{q\})$
Each $S_q$ and $T_q$ is connected.
The union $S$ of the family $S_q$ is connected and the union $T$ of the family $T_q$ is connected.
The union of $S$ with $T$ is connected. But that is the subspace that the OP is analyzing.