# Dense continuous image of compact Hausdorff space

Suppose I have compact Hausdorff spaces $X$ and $Y$, a continuous function $f: X \rightarrow Y$, such that $f(X)$ is dense in $Y$. How can I show that $f(X)=Y$?

What I've tried is this– consider a point $y \in Y$ such that $y \notin f(X)$. Then since $Y$ is Hausdorff, there must be open sets $U_{y_i}$ and $U_{f(x_i)}$ separating $y$ and every point in $f(X)$; the $U_{f(x_i)}$ form a cover of $f(X)$, and thus must have a finite subcover. I don't know where to go from there. I do know that a compact Hausdorff space is normal. Any hints would be appreciated.