Continuous injection between the compact space and the subspace topology inherited from $Y$ is a homeomorphism. Let $X$ and $Y$ be topological spaces. 
I need to prove the following:

Prove that if $X$ is compact, $Y$ is Hausdorff and $f:X \to Y$ is continuous and one-to-one (injective), then $f:X \to f\left( X \right)$ is a homeomorphism. Also, note that here $f\left( X \right)$ has the subspace topology inherited from $Y$.

There was a similar question here asked already, but now I need to show $f:X \to f\left( X \right)$ is a homeomorphism, where $f$ is only injective and $f(X)$ has the subspace topology inherited from $Y$.
How can I go about proving this using the fact that $f(X)$ has the subspace topology inherited from $Y$?
 A: Let's try to prove it "directly" as you said.
Let $X$ and $Y$ be topological spaces such that $X$ is compact, $Y$ is Hausdorff.
Suppose that $f:X  \longrightarrow Y$ is continuous and one-to-one. Let's prove that  $\tilde{f}: X \longrightarrow f(X)$ is a homeomorphism.
Clearly, the function $\tilde{f}: X \longrightarrow f(X)$ is one-to-one (because $f$ is) and surjective, so it is a bijection. 
Let $V$ be an open set in $f(X)$. Thus, as $f(X)$ is given the subspace topology, we have that $V= U \cap f(X)$ where $U$ is open in $Y$.
Then, $\tilde{f}^{-1}(V)=\tilde{f}^{-1}(U) \cap X=f^{-1}(U)$ which is open in $X$ as $f$ is continuous. So that $\tilde{f}$ is continuous.
Consider now, the inverse function of $\tilde{f}$, $\tilde{f}^{-1}: f(X) \longrightarrow X$.
Let $U$ be a closed set in $X$. Then as $X$ is compact, $U$ is compact. Thus
$(\tilde{f}^{-1})^{-1}(U)=\tilde{f}(U)=f(U)$ is compact as $f$ is continuous (a continuous image of a compact set, is compact!).
Now,  $f(X) \subset Y$ and so $f(X)$ is Hausdorff. Moreover, $f(U) \subset f(X)$ implies that $f(U)$ is closed (compact subsets of a Hausdorff space are closed).
This is, $(\tilde{f}^{-1})^{-1}(U)$ is closed . Then, $\tilde{f}^{-1}$ is continuous.
We conclude that $\tilde{f}: X \longrightarrow f(X)$ is a homeomorphism.
A: Well, since $f(X)$ inherits the subspace topology, you get that $\bar{f}:X\to f(X)$ given by $\bar{f}(x)=f(x)$ is continuous. It is also a bijection, since $f$ is injective. Since $Y$ is Hausdorff, then so is any subspace of $Y$. In particular $\bar{f}$ is a continuous bijection from a compact space into a Hausdorff space and hence, a homeomorphism.
