Let $X$ and $Y$ be two metric space such that $X$ is compact. Then show that any continuous bijection $f:X \to Y$ is a homeomorphism.
Attempt
Our target is to show that $f^{-1}$ is continuous.
To prove this let $\{y_n\}$ be a sequence in $Y$ such that $y_n \to y$.
So, $\{f^{-1}(y_n)\}$ is a sequence in $X$ and $X$ is compact. Hence $\{f^{-1}(y_n)\}$ has a subsequence converging to $x$ (say).
Let $\{x_{n_k}\}$ be the subsequence $x_{n_k} \to x$.
Now $f(x_{n_k}) \to f(x)$.
And $f(x_{n_k})$ is a subsequence of $y_n$. Hence $f(x)=y$. Hence $\{f^{-1}(y_n)\}$ has a subsequence converging to $f^{-1}(y)$.
Now how can I show that the whole sequence $\{f^{-1}(y_n)\}$ is convergent?
I have another method to solve this problem.So please help for this method only.
I know that the usual proof that a continuous map takes compact sets to compact sets (via sequences) uses contradiction. Proving that $f^{-1}$ is continuous is equivalent to $f$ taking closed (i.e. compact) sets to closed sets. Therefore, we should try contradiction.
Assume $y_n \to y$, let $x_n = f^{-1}(y_n)$ and $x = f^{-1}(y)$. Assume $x_n \not\to x$. Take a convergent subsequence where $|x_{n_k} - x| \ge \varepsilon > 0$. Also note that $f(x_{n_k}) = y_{n_k}$ is a subsequence of $(y_n)$ so $y_{n_k} \to y$. Show that you get a contradiction here.
If you know what "Hausdorff" means, you can see how that hypothesis is used in the argument linked to in the comments. If $Y$ is not Hausdorff, it is possible for a sequence in $Y$ to have more than one limit. But in a metric space (which is Hausdorff) a convergent sequence has a unique limit.