TITLE: is continuous image of dense set dense?
QUESTION [10 upvotes]: Here is the problem:
Let $f : X \to Y$ be a continuous map between topological spaces.  Let $E$ be a dense subset of $X$ (that is, $\operatorname{Cl} E = X$), where $\operatorname{Cl}E$ represents the closure of $E$.  Prove: $\operatorname{Cl} f(E) = f(X)$
I know continuity of $f$ implies $f(\operatorname{Cl} E) \subseteq \operatorname{Cl} f (E)$, but I have no idea to show the converse.

REPLY [2 votes]: Yes, this is true. 
Suppose $f: X \rightarrow Y$ is a continuous map and $A$ is some dense subset of $X$. To see that $f(A)$ is dense in $f(X)$, we can show that the $f(X)$-relative closure of $f(A)$ equals the whole of $f(X)$. 
So, let $y$ be any point in $f(X)$ and consider some open neighbourhood $U$ of $y$ in $f(X)$. Spelling this out, $U$ is open in $f(X)$ iff $U = f(X) \cap V$, where $V$ is some open subset of $Y$. Since $f$ is continuous, the pre-image $$f^{-1}(V) = \{ x \in X \ | \ f(x) \in V \}$$ is open in $X$. However, this set is precisely equal to $f^{-1}(U)$. 
So, we can conclude that $f^{-1}(U)$ is open in $X$. 
Since $A$ is dense, it must be the case that $f^{-1}(U) \cap A$ is non-empty (think: dense subsets are "close" to everything). Alternatively, this can be argued formally as follows: since $y \in f(X)$, there is some $x \in X$ such that $f(x) = y$. Thus $x\in f^{-1}(U)$, and then $Cl(A) = X$ implies that $x \in Cl(A)$ and thus $f^{-1}(U) \cap A \neq \emptyset$.   
Then any element in the intersection $f^{-1}(U) \cap A$ will get mapped into the set $U \cap f(A)$ under $f$. Hence the set $U \cap f(A)$ is non-empty. Since we chose $U$ arbitrarily, it follows that $y$ lies in the $f(X)$-relative closure of $f(A)$. Then, since we chose $y$ arbitrarily, we may conclude that $f(X) = Cl(f(A))$, that is, $f(A)$ is dense in $f(X)$.