If $D$ is dense in $X$, prove that $\overline {D \cap G}=\overline {G} $ for every open subset $G$ of $X$. If $D$ is dense in $X$, prove that $\overline {D \cap G}=\overline {G} $ for every open subset $G$ of $X$. 
I try this:
If  $D$ is dense then we have that $G\subset D$, more general all open sets are contain in $D$, then using a closure property  $\overline {D \cap G}=\overline {G} \cap \overline{D} $, but   $G\subset D$ then  $\overline{G} \subset\overline{D}$, finally $\overline {D \cap G}=\overline {G} \cap \overline{D} = \overline{G} $
Is it correct? thanks you so much
 A: Here is a slightly different approach.
We always have $\overline{D \cap G} \subset \overline{G}$ since $D \cap G \subset G$.
Can the reverse containment $\overline{G} \subset \overline{D \cap G}$ fail to hold? Observe that $\overline{G} \subset \overline{D \cap G}$ if and only if $G \subset \overline{D \cap G}$. So if this containment is false, then $G$ has nontrivial intersection with $(\overline{D \cap G})^c$, so $U = G \cap (\overline{D \cap G})^c$ is a nonempty open set which does not intersect with $D \cap G$. Since $U \subset G$, this implies that $U$ does not intersect with $D$. Therefore $D$ must be contained in the closed set $U^c$, so $\overline{D} \subset U^c$. But $D$ is dense in $X$, so $\overline{D} = X$, hence $X = U^c$. This is a contradiction because $U$ is nonempty.
A: Dense sets don't contain every open set, they just intersect every (nonempty) open set.  So you can't say that $G\subset D$; you can only say that $D\cap G$ is nonempty (if $G$ is nonempty and open).
But to prove that $\overline{G}=\overline{D\cap G}$, you aren't going to want to use that property for $G$ itself; rather, you will want to use it for other open sets.  To get you started, suppose you have a point $x\in\overline{G}$.  You want to show that $x\in \overline{D\cap G}$.  So for any open neighborhood $U$ of $x$, you want to show $(D\cap G)\cap U$ is nonempty.  Can you see any way to show this?
A: Here is a proof by algebra only. We only need to prove $\:{G} \subset \overline{D \cap G}\:$ for $\:\overline{G} \subset \overline{D \cap G}\:$ follows easily.
\begin{align}
G-\overline{D \cap G}\:&=\:G\cap((D \cap G)^c)^o\qquad\qquad\qquad\quad\qquad{\overline{A}=((A^c)^o)^c}
\\
&=\:G^o\cap(D^c \cup G^c)^o
\\
&=\:((G\cap D^c) \cup (G\cap G^c))^o\qquad\qquad\qquad{(A\cap B)^o=A^o\cap B^o}
\\
&=\:G\cap (D^c)^o
\\
&=\:G-\overline{D}
\\
&=\:G-X
\\
&=\:\varnothing
\end{align}
