Problem: Show that $\mathbb{R} ^2 \setminus \mathbb{Q} ^2$ is path connected. What about $\mathbb{R} \setminus \mathbb{Q} $?
Solution: Let us take two points $A = (p,q)$ and $B=(x,y)$. We will show that there exists a path lies in $\mathbb{R} ^2 \setminus \mathbb{Q} ^2$ joining $A$ to $B$. There are four possibilities
Note that in the first case, we have a path shown in Figure 1 which lies in $\mathbb{R} ^2 \setminus \mathbb{Q} ^2$ because $q\in \mathbb{R} ^2 \setminus \mathbb{Q} ^2$ and $x \in \mathbb{R} ^2 \setminus \mathbb{Q} ^2$. Similarly, if $p,y \in \mathbb{R} ^2 \setminus \mathbb{Q} ^c$, then Figure 2 shows a valid path between $A$ and $B$.
Figure 1: $q\in \mathbb{Q} ^c$ and $x\in \mathbb{Q} ^c$
Figure 2: $p\in \mathbb{Q} ^c$ and $y\in \mathbb{Q} ^c$
Now, if $p\in \mathbb{Q} ^c$ and $x\in \mathbb{Q} ^c$, then we can not follow the vertical line and horizontal line trick. So we choose an irrational number smaller than $y$ (one can take larger also), say $q^\prime $. The path
Therefore, we have the following path in the last two cases.
Figure 3: $p\in \mathbb{Q} ^c$ and $x\in \mathbb{Q} ^c$
Figure 4: $q\in \mathbb{Q} ^c$ and $y\in \mathbb{Q} ^c$
We claim that the set $\mathbb{R} \setminus \mathbb{Q} $ is not path connected. For proving this, consider points $A = \sqrt{2} $ and $B = -\sqrt{2} $, then there does not exist any path joining $A$ and $B$ which completely lies in $\mathbb{R} \setminus \mathbb{Q} $, as $\mathbb{Q}$ is dense in $\mathbb{R}$ so any path will intersect rational points. Hence, $\mathbb{R} \setminus \mathbb{Q} $ is not path connected.