Problem: Let $(X,d)$ be any metric space. Suppose that every function \[ f: (X,d) \to \left( \mathbb{R}, d_{\textup{Euc}} \right) \] is continuous, where $d_{\textup{Euc}}$ is the Euclidean metric on $\mathbb{R} $. Then prove that $d$ is the discrete metric.
Solution: If $X$ has only one point, then it has has the discrete metric. So we assume that $X$ has at least two points. Let $p\in X$. Consider the function \[ f_p:X\to \mathbb{R} ,~ \begin{dcases} 0, &\text{ if } p\in X ;\\ 1, &\text{ if } p\notin X. \end{dcases} \]
According the given hypothesis, the function $f_p$ is continuous for every $p\in X$. So, we have \[ f^{-1}(\{0\}) =\{p\},~\text{and }~ f^{-1}(\{1\}) = X\setminus \{p\}. \] Since $f_p$ is continuous, and $\{1\}$ is a closed set, so $f^{-1}(\{1\}) = X\setminus \{p\}$ will be closed and hence $\{p\}$ will be open. So we showed for every $p\in X$ the set $\{p\}$ is open. We have the following result which proves that $d$ is the discrete metric.