# Dense sets in a subset of $\mathbb{R}$

$\def\Irr{\operatorname{Irr}}$ Let $\mathbb{R}$ be the space of real numbers. If $A$ is a dense set in $\mathbb{R}$ and $B \subset \mathbb{R}$. We know that $A\cap B$ need not be dense in $B$. By dense sets in $B$, I mean $\overline{A\cap B}=B$.

For example, take $A=\mathbb{Q}$ "the set of all rational numbers", and take $B=\left\{1\right\}\cup \Irr$, where $\Irr$ is the set of all irrational numbers. Then it is clear that $A$ is dense in $\mathbb{R}$; however, $A\cap B$ is not dense in $B$.

My question is that: Under what conditions, the statement will be true; i.e. when $A\cap B$ will be dense in $B$, if $A$ is a dense in $\mathbb{R}$?

The answer is positive if $B$ is open, as it has topology induced by the topology of $X$ (here $R$).
• The more crucial question is: if a set $B$ satisfies the property that for all $D\subset \mathbb{R}$ dense, $B\cap D$ is dense in $B$, must $B$ be open? – guest Nov 4 '14 at 0:42
• @guest At least for $\bf R$ not. A counterexample is $[0,1]$. – Przemysław Scherwentke Nov 4 '14 at 0:44
• @Przemysław Scherwentke, If $B$ is open set, then how it will be equal to the closure of a set which is actually closed? – Sara Nov 4 '14 at 0:49