Hausdorff Space and Continuous map Problem: Suppose $X$ is a topological space and for every $p\in X$  there exists a a continuous function $f: X\rightarrow \mathbb{R}$ such that $f^{-1}$ $\{$ $0$ $\}$ $=$ $\{$ $p$ $\}$. Show that $X$ is Hausdorff.
My proof:
Let $x_1,x_2$ be distinct points in $X$ , so $\exists$ $f_1$ $:X\rightarrow \mathbb{R}$ such that $f_1^{-1}(0)$ $=$ $\{$ $x_1$ $\}$ and $f_2 : X\rightarrow \mathbb{R}$ such that $f_2^{-1}(0)$ $=$ $\{$ $x_2$ $\}$. As every finite subset of a metric space is open, it follows that $\{$ 0 $\}$ is open in $\mathbb{R}$, and since $f_i$ is continuous, the preimage of every open set is open, and thus we have found open sets $\{$ $x_1$ $\}$ and $\{$ $x_2$ $\}$ containing $x_1,x_2$ respectively that are disjoint.
Is the proof correct, may I please have feedback?
 A: Your proof is wong because it assumes that  every finite subset of a metric space is open, which is false.
If $p,q\in X$ and $p\neq q$, take a continuous map $f\colon X\longrightarrow\mathbb R$ such that $f^{-1}\bigl(\{0\}\bigr)=\{p\}$. Then $f(q)\neq0$. Take $\varepsilon=\frac12\bigl\lvert f(q)\bigr\rvert$. Then:


*

*$f^{-1}\bigl((-\varepsilon,\varepsilon)\bigr)\cap f^{-1}\bigl((f(q)-\varepsilon,f(q)+\varepsilon)\bigr)=\emptyset$;

*$p\in f^{-1}\bigl((-\varepsilon,\varepsilon)\bigr)$;

*$q\in f^{-1}\bigl((f(q)-\varepsilon,f(q)+\varepsilon)\bigr)$;

*$f^{-1}\bigl((-\varepsilon,\varepsilon)\bigr)$ and $f^{-1}\bigl((f(q)-\varepsilon,f(q)+\varepsilon)\bigr)$ are open sets.


This completes the proof that $X$ is Hausdorff.
A: No, your proof is not valid because you are assuming that $\{0\}$ is open in $\mathbb {R}$ which is not true. 
There is no open interval of real numbers centered at $0$ which is completely contained in the singleton $\{0\}$ 
A: José Carlos Santos's proof can be restated in a way that allows one to replace $\mathbb{R}$ by any Hausdorff space $Y$.
Let $f:X \to Y$ be a continuous map such that $f^{-1}(p) = \{0\}$ and let $q \in X$ with $p ≠ q$. Then $f(p) = 0 ≠ f(q)$. Since $Y$ is Hausdorff, there exist some disjoint neighbourhoods $U$ and $V$ of $f(p)$ and $f(q)$, respectively. Since $f$ is continuous, $f^{-1}(U)$ and $f^{-1}(V)$ are disjoint open sets of $X$ and by construction, $p \in f^{-1}(U)$ and $q \in f^{-1}(V)$. Thus $X$ is Hausdorff.
