Preimage of a dense set under continuous onto function

general-topology

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?

Best Answer

Not true. Consider the identity map $\operatorname{id}\colon \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 $\operatorname{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\colon \mathbb{R} \rightarrow \mathbb{R}_{\ge 0}$ by setting $f(x) =0$ if $x<0$ and $f(x)=x$ 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.