Let $\mathfrak{M}$ and $\mathfrak{N}$ be perfect Polish spaces, $P$ a nonempty perfect subset of $\mathfrak{M}$, and $f: \mathfrak{M} \rightarrow \mathfrak{N}$ a continuous surjection that's injective on $P$. Naively, the image $f[P]$ should be perfect. For if it has an isolated point $x$ with a neighborhood $X$ containing no other elements of $f[P]$, then by continuity and injectivity the preimage $f^{-1}[X]$ is an open set containing no points of $P$ other than the unique element $p$ mapped to $x$, contradicting perfection. However, someone suggested to me that this argument fails unless $P$ is compact. Is this true?