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?
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\}$