Pre-image of Hausdorff space is Hausdorff 
Let $X, Y$ be topological spaces, with Y a Hausdorff space. Prove that if there exists an injective and continuous function $f: X \rightarrow Y$, then $X$ is Hausdorff.


Here's my idea:
Since $Y$ is Hausdorff, different points $x,y \in Y$ have disjoint neighborhood $U \subset \tau_x,V \subset \tau_y$.
But $f$ is also continuous, so the pre-image of these sets is an open set in $X$, say $f^{-1}(U)=A$, $f^{-1}(V)=B$. Now, because $f$ is injective, I got that $A \cap B = \emptyset$, and $f^{-1}(x)$, $f^{-1}(y)$ have disjoint neighborhoods.
 A: There's a jump in your proof: you write that $x$ and $y$ have disjoint neighborhoods $U\in\tau_x$ and $V\in\tau_y$ (note that you wrote $U\subset\tau_x$ and $V\subset\tau_y$; this is wrong), and, in the next sentence, you write that the pre-images of $U$ and $V$ are open sets. Why?
There are two ways of solving this:


*

*Use the fact that the pre-image of a neighborhood by a continuous function is again a neighborhood.

*You can assume without loss of generality that $U$ and $V$ are open sets.

A: Take distinct $x,y \in X$ then $f(x), f(y)$ are distinct points in $Y$ (by injectivity) and so we have disjoint open sets $U$ and $V$ containing $f(x)$ and $f(y)$, respectively. Now their preimages $f^{-1}(U)$ and $f^{-1}(V)$ are open (by continuity), disjoint and contain $x$ and $y$. 
A: Let $x_1,x_2 \in X$ such that $x_1 \neq x_2$
Then $f(x_1),f(x_2) \in Y$ and $f(x_1) \neq f(x_2)$ because $f$ is injective.
Then there exist two disjoint open sets $U_1,U_2 \in \mathcal{T_Y}$ such that $f(x_1) \in U_1$ and $f(x_2) \in U_2$ 
Thus $$x_1 \in f^{-1}(U_1)$$ $$x_2 \in f^{-1}(U_2)$$ where $ f^{-1}(U_1),f^{-1}(U_2)$ are open in $X$ because $f$ is continuous and $U_1,U_2$ are open in $Y$.
Put $V_1=f^{-1}(U_1)$ and $V_2=f^{-1}(U_2)$ and you have: $$V_1 \cap V_2 =f^{-1}(U_1) \cap f^{-1}(U_2)=f^{-1}(U_1 \cap U_2)=f^{-1}(\emptyset)=\emptyset$$
Therefore $X$ is Hausdorf.
A: Let $x_1,x_2$ be distinct in $Y$. By injectivity of $f$, $f(x_1),f(x_2)$ are distinct. Since $Y$ is hausdorff, there exists disjoint neighborhoods $U_i$ of $f(x_i)$. By continuity of $f$, $f^{-1}(U_i)$ is open for each $i$ and contains $x_i$. Since $f^{-1}(U_1)\cap f^{-1}(U_2)=f^{-1}(U_1\cap U_2)=f^{-1}(\varnothing)=\varnothing$, $X$ is hausdorff. 
