We have a well-known theorem in metric spaces.The statement is in the following:
Statement: Let $X$ and $Y$ be metric spaces,and $f:X\to Y$ be a continuous bijection and $X$ be compact,then $f^{-1}:Y\to X$ is also continuous and hence $f$ is a homeomorphism.
Now,we start the proof by taking a closed set $F$ in $X$,we want to show that $(f^{-1})^{-1}(F)$ is closed in $Y$.Since,$f$ is a bijection $(f^{-1})^{-1}(F)=f(F)$.Now $F$ is closed in $X$ and $X$ is compact,so $F$ is compact.$f$ is continuous ,so $f(F)$ is compact in $Y$ and hence closed in $Y$ and we are done.
In the last line,we are using the fact that a subset of a metric space is closed if it is compact.But I think it is not true in a general topological space.So,we could not give that argument there.So,does this theorem still hold if $X$ and $Y$ are topological spaces but not a metric space with $X$ compact?
In general, no; let $Y$ be any set with the same cardinality as $X$ and equipped with the trivial (indiscrete) topology.
If $Y$ is Hausdorff, yes. In this case it is again true that every compact subset of $Y$ is closed, and the proof goes through as before.