I was wondering if we can construct a continuous function $f:X \rightarrow \mathbb{R}$ that is not the constant function. Here X is an arbitrary infinite set with some metric d defined on it. The metric on $\mathbb{R}$ is the euclidean metric. I am solving a problem where I need to use the fact that such a function exists but I have no clue where to begin.
Edit: I have modified the problem to include a metric d on X.