Let $(X,\tau_X)$ and $(Y,\tau_Y)$ be topological spaces, let $f:X\to Y$ be a homeomorphism, and let $K\subset X$. Equip $K$ with the [subspace topology](/page/Subspace%20Topology) inherited from $X$, and equip $f(K)$ with the subspace topology inherited from $Y$. Then $K$ is compact if and only if $f(K)$ is compact.