I noticed the following statement on a comprehensive exam, and I am having trouble proving it. Can anyone help?
If $X$ is a non-compact metric space, then there exists a continuous function $f: X \rightarrow \mathbb{R}$ such that $f(X)$ is dense in $\mathbb{R}$.
Thanks in advance!