TITLE: If $A$ is dense in $\Bbb Q$, then it must be dense in $\Bbb R$.
QUESTION [10 upvotes]: I have $A$ is a subset of $\mathbb{R}$. If $A$ is dense in $\mathbb{Q}$, then it must be dense in $\mathbb{R}$. I am confused because $A$ is dense in $\mathbb{Q}$. Does that imply that between any two rational numbers, there exists a real number? I understand for anything to be dense in $\Bbb R$, there must exist something that lies between any two real numbers. However, how does knowing something is dense in $\mathbb{Q}$ prove that it must be dense in the reals? Any help is appreciated.

REPLY [2 votes]: There is a more general statement of this theorem. Let $X$ be a topological space and suppose $Z \subset Y \subset X$. If $Y$ is dense in $X$ and $Z$ is dense in $Y$ (w.r.t. the subset topology) then $Z$ is dense in $X$.
To prove this, suppose $Z$ is not dense in $X$. Then there exists $A$ open and non-empty in $X$ such that $Z \cap A = \emptyset$. Then we have two cases depending on if $A' = Y \cap A$ is non-empty. If $A'$ is empty then $A \cap Y = \emptyset$ therefore $Y$ is not dense in $X$. Else $A'$ is non-empty and open in $Y$ w.r.t. the subset topology, and $A' \cap Z = \emptyset$. Hence $Z$ is not dense in $Y$. Either way we have a contradiction.