I am following a proof for the theorem:
Let g be a 1-1 continuous function from a compact space $A$ into a Hausdorff space $B$. Then $A$ and $g[A]$ are homeomorphic.
Proof:Clearly $g:A \rightarrow g[A]$ is onto, and given that $g$ is 1-1 and continuous, so $g^{-1} : g[A] \rightarrow A$ exists.It must be shown that $g^{-1}$ is continuous.$g^{-1}$ is continuous if for every closed subset of $F$ of $A$, $(g^{-1})^{-1}[F] = g[F]$ is a closed subset of $g[A]$. Now, the closed subset $F$ of a compact space $A$ is also compact. Since $g$ is continuous, $g[F]$ is a compact subset of $g[A]$.
I did not understand the last sentence. How it will be true.