TITLE: $f : X \to Y $ continuous and surjective. $A $ dense in $X$ $\implies$ $f(A)$ dense in $Y$
QUESTION [6 upvotes]: $$ \textbf{PROBLEM} $$
$f : X \to Y $ continuous and surjective. $A $ dense in $X$ $\implies$
  $f(A)$ dense in $Y$

$$ \textbf{SOLUTION(ATTEMPT)} $$
Suppose $A$ is dense in $X$. Then we must have by definition that $Cl(A) = X $. Since $f$ enjoys surjectivity, we must have $f(X) = Y $. This implies $f(Cl(A)) = Y $. We must show $Cl(f(A)) = Y$. So my claim is that $f( Cl(A)) = Cl( f(A) )$ if $f$ is continous. But I am stuck how can I prove this claim. Any ideas?

REPLY [9 votes]: Suppose $V$ is a closed subset of $Y$ containing $f(A)$. Then $f^{-1}(V)$ is a closed subset of $X$ containing $A$, and therefore $f^{-1}(V) = X$ because $A$ is dense in $X$. Therefore, since $f$ is surjective, $f(f^{-1}(V)) = V =f(X) = Y$. Thus $V=Y$, so $f(A)$ is dense in $Y$.

REPLY [8 votes]: What you’re trying to prove isn’t true; as Pedro says in his answer, continuity of $f$ guarantees only that $\operatorname{cl}f[A]\supseteq f[\operatorname{cl}A]$ for sets $A\subseteq X$. The proof can be carried out that way, but I find other approaches easier.

First show that if $X$ is any space, a set $D\subseteq X$ is dense in $X$ if and only if $U\cap D\ne\varnothing$ whenever $U$ is a non-empty open set in $X$. (Added: Reading back, I see from this question that you’ve already encountered this fact.)  
Then let $U$ be a non-empty open set in $Y$; you want to show that $U\cap f[A]\ne\varnothing$. What can you say about $f^{-1}[U]$?