Suppose that $(X,ρ)$ is a metric space, $f:(X,ρ)\rightarrow R$ a continuous function and $D$ a dense subset of $X$ so as $f(D)$ finite. Prove that:
(i) The range $f(X)$ is finite
(ii) For every $t\in f(X)$, $f^{-1}\ (\{t\})$ is simultaneously open and closed in $X$.
For (i), you should use the density of $D$ to prove that $f(D)=f(X)$. And (ii) is just a consequence from the fact that in a finite subset of $\mathbb R$, singletons are both open and closed.