Let $\displaystyle M$, $\displaystyle N$ be metric spaces and assume $\displaystyle M$ is compact. Show that if $\displaystyle f:M \rightarrow N $ is a bijective and continious function, then $\displaystyle f$ is a homeomorphism.

And does this hold even if we dont assume that M is compact?