A subset $A$ of a topological space $(X,\tau)$ is said to be dense if $\overline A=X$. Prove that if for each open set $O\neq\varnothing$ we have $A\cap O\neq\varnothing$, then $A$ is dense in $X$.
Could you please check if the following is right? Thanks!
A characterization of $\overline A$ is $$\overline A=\bigcap_{\alpha\in I} F_\alpha$$ where $\{F_\alpha\}_{\alpha\in I}$ is the family of all closed sets containing in $A$.
($C(Y)$ denote the complement of a set $Y$) Then $$C(\overline A)=C\left(\bigcap_{\alpha\in I} F_\alpha\right)=\bigcup_{\alpha\in I}C(F_\alpha)$$ where $O_\alpha:=C(F_\alpha)$ is open, for all $\alpha\in I$.
Since $A\subset F_\alpha$ for all $\alpha\in I$, we have $O_\alpha\subset C(A)$, and since $O_\alpha(\neq\varnothing)$ is open, by hypothesis $O_\alpha\cap A\neq\varnothing$. But this is impossible, so $O_\alpha=\varnothing$ for each $\alpha$, and thus $$C(\overline A)=\bigcup_{\alpha\in I}\varnothing =\varnothing $$
This leads to $\overline A=C(\varnothing)=X$.