If $G$ is a dense proper subgroup of $H$ with induced topology and $\theta$ is the embedding map then $\pi$ is an isomorphism but the image of $\theta$ is not closed. For example, consider $\mathbb{Q} < \mathbb{R}.$