Preimage of a dense set under continuous onto function I know preimage of a dense set under open map is dense.  Is it true that preimage of a dense set under continuous onto function is dense? 
Actually when I did the problem that continuous onto image of a dense set is dense.  Suddenly I thought that question.  Is that true?  If so,  then how to prove?  
 A: Not true. Consider the identity map $id: \mathbb{R} \rightarrow \mathbb{R}$ where the first $\mathbb{R}$ is endowed with the discrete topology and the second, the euclidean topology. This map is continuous and surjective. 
$\mathbb{Q}$ is dense in $\mathbb{R}$ under the Euclidean topology. Its inverse image under $id$ is also $\mathbb{Q}$. But $\mathbb{Q}$ is not dense in $\mathbb{R}$ under the discrete topology. 
EDIT: OP asked the following: If we allow both $X$ and $Y$ to be $\mathbb{R}$ with the usual Euclidean topology. Will the hypothesis be true? The answer is no. 
Consider the function: $f: \mathbb{R} \rightarrow \mathbb{R}_{\ge 0}$ by setting $f(x) =0$ if $x<0$ and $f(x)=0$ if $x\ge 0$. This map is continuous and surjective. The set $D=(0,\infty)$ is dense in $\mathbb{R}_{\ge 0}$. But its preimage under $f$, which is still $(0,\infty)$, is not dense in $\mathbb{R}$! A huge reason is because the map $f$ is not open. 
A: False.
Brief/Nutshell argument:  False because then the pre-image of any non-empty proper subset would be dense in the discrete topology; which it can't.  
Full argument:  Cosider this counterargument: 


*

*Let $\{\emptyset,X\}=\tau_1\subset \tau_2=2^X$ be the indiscrete and the discrete topologies on a set $X$ with at-least 2 points.  

*The closure of any non-empty subset $Y$ of $(X,\tau_1)$ must be equal to all of $X$ itself (since the only $\tau_1$-closed set containting $Y$ must be $X$).  In particular, the $\tau_1$-closure $cl_{\tau_1}(\{x\})$ of any point $x\in X$ must be equal to all of $X$.  That is, $\{x\}$ is dense in $(X,\tau_1)$.  

*Since the complement of $x$ is $X-\{x\}\in 2^X$, then the $\tau_2$-closure of $\{x\}$ in $X$ is itself $\{x\}$; which by assumption was not $X$ itself since the latter contained at-least two points.  

*Every function $f:(X,\tau_2)\rightarrow (X,\tau_1)$ is [continuous][2] since then every
$$
U\in \tau_1  \Rightarrow f^{-1}[U] \in 2^X = \tau_2.
$$
In particular, the map $f(y)=y$ is continuous from $(X,\tau_2)$ to $(X,\tau_1)$.   

*Now, consider the $\tau_1$-dense subset $\{x\}$ and note that
$$
cl_{\tau_2}\left(f^{-1}[\{x\}]\right)=cl_{\tau_2}\left(\{x\}\right)=\{x\}\neq X 
\mbox{ but } cl_{\tau_1}\left(f^{-1}[\{x\}]\right)=X
$$ 
Therefore, 1 is false.


Intuitive explanation:  If 1 were true then basically any set would be dense since you could "transfer density" from arbitrarily coarse topologies to arbitrarily fine ones.   
