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.