Is $\mathbb{Q}^{2}\cup \mathbb{I}^{2} $ connected? It is well-known that $\mathbb{Q}^{2}$ and $\mathbb{I}^{2}$ (where $\mathbb I = \mathbb R\setminus \mathbb Q$) are disconnected spaces with the usual topology from $\mathbb{R}^{2}$, but how about the union? I figure it is, but I couldn't solved it. I've tried to express the set as the union of connected sets with nonempty intersection, because I think that is the key; but I reached nowhere.
 A: Suppose $(a,b)$ and $(c,d)$ are two points in $Q^2 \cup I^2$ with $a \ne c$ and $b \ne d$.
Then I claim there is a curve of the form $(x, f(x))$ for $x \in [\min(a,c), \max(a,c)]$
where $f$ is a continuous monotone function such that $f(a) = b$, $f(c)=d$, and $f(x)$ rational if and only if $x$ is rational. 
If so, $(a,b)$ and $(c,d)$ are in the same connected component of $Q^2 \cup I^2$.
For simplicity, consider the case where $a < c$ and $b < d$.  If $m = (d-b)/(c-a)$ is the slope of the line segment joining $(a,b)$ to $(c,d)$, you can construct $f$ so that 
all secant lines $(r,f(r))$ to $(s,f(s))$ where either $r=a$ or $r$ is rational or $f(r)$ is rational, and
either $s=b$ or $s$ is rational or $f(s)$ is rational, have slope strictly between $m/2$ and $2m$.  The curve is constructed by an inductive procedure using enumerations of
the rationals in $(a,c)$ and the rationals in $(b,d)$. At each stage, we will have a 
piecewise-linear curve from $(a,b)$ to $(c,d)$.  We take either the next rational $r$ in $(a,c)$ or the next rational $s$ in $(b,d)$: if the point on the curve corresponding to $x=r$ or $y=s$ is not in $Q^2$, we move it slightly in the vertical or horizontal direction (respectively) so that it is in $Q^2$, but the slopes of the modified piecewise-linear curve are still all strictly between $m/2$ and $2m$.
Then it is easy to show that the limit of these piecewise-linear curves exists and is a continuous curve $(x,f(x))$ such that $x$ is rational if and only if $f(x)$ is rational.
A: Another way of saying the same idea as Robert Israel. Take families of rationals $p_n,q_n$ ($n\in\mathbb Z$) such that: $p_n<p_{n+1}$; $q_n\ne q_{n+1}$; $p_n\to a$ and $q_n\to b$ as $n\to-\infty$; and  $p_n\to c$ and $q_n\to d$ as $n\to\infty$. Take segment of every $(p_n,q_n)$ to $(p_{n+1},q_{n+1})$. The union of all of these segments, together with the points $(a,b)$ and $(c,d)$, is the graph of a continuous function $f:[a,c]\to\mathbb R$ satisfying what Robert Israel asserts.
