Is $\mathbb{Q} \times \mathbb{Q} \cup \mathbb{I} \times \mathbb{I}$ disconnected?

The set is connected.

Suppose that the set is disconnected by disjoint open sets $U$ and $V$. So, we assume that $\mathbb{Q}\times\mathbb{Q} \cup \mathbb{I}\times\mathbb{I}\subseteq U\cup V$ and $U\cap V=\phi$.

Find open balls $B_U \subseteq U$ and $B_V\subseteq V$. Then we can find a line of the form $y=q_1x + q_2$ with $q_1\in \mathbb{Q}-\{0\}$, $q_2\in\mathbb{Q}$ such that the line goes through both balls. Note that this line takes rational to rational, irrational to irrational. Thus, $\{(x,y)|y=q_1x+q_2\}\subseteq\mathbb{Q}\times\mathbb{Q} \cup \mathbb{I}\times\mathbb{I}$.

However, since $U$ and $V$ disconnects the set $\mathbb{Q}\times\mathbb{Q} \cup \mathbb{I}\times\mathbb{I}$, so we can find a point on the line that does not belong to any of $U$ or $V$. This is a contradiction.


Here's a slightly different way to think about it in terms of components:

Suppose $(a,b), (c,d) \in \mathbb{Q}^2.$ Then the lines $$x+y = a+b \\ x-y = c-d$$ are continuous paths in $\mathbb{Q}^2 \cup \mathbb{I}^2 \subset \mathbb{R}^2$ containing $(a,b), (c,d)$ respectively and intersecting at $\left(\frac{1}{2}(a+b+c-d), \frac{1}{2}(a+b-c+d)\right).$ In particular, this shows that $\mathbb{Q}^2$ lies in a single path-component of $\mathbb{Q}^2 \cup \mathbb{I}^2.$ Therefore (since path components refine connected components) there is a connected component $C \subseteq \mathbb{Q}^2 \cup \mathbb{I}^2$ such that $\mathbb{Q}^2 \subseteq C.$

Finally, since $\mathbb{Q}^2$ is dense in $\mathbb{R}^2,$ it is also dense in any subspace containing it, showing that $$C \subseteq \mathbb{Q}^2 \cup \mathbb{I}^2 = \text{cl}(\mathbb{Q}^2) \subseteq \text{cl}(C) = C$$ so $\mathbb{Q}^2 \cup \mathbb{I}^2 = C$ is connected.


Let $S = \mathbb{Q}^2 \cup \mathbb{I}^2$. For each nonzero rationals $q$, let $L_q$ be the line through the origin with slope $q$. Then $L_q \subseteq S$. Let $T=\bigcup_{q \in \mathbb{Q}\setminus \left\{0 \right\}} L_q$. Then $T$ is connected in $S$. Moreover $\overline{T}$ relative to $S$ itself is equal to $S$. Therefore $S$ is connected.