Suppose $f$ is a morphism of Lie groups, and $df_e\colon T_eG_1\to T_eG_2$ is a surjective map of the tangent spaces of two Lie groups, where $G_2$ is connected.
I read that by the Inverse Function Theorem, $df_e$ surjective implies $f$ is surjective onto a neighborhood $U$ of $e$ in $G_2$. Then since $G_2$ is connected, it is well known that $U$ generates $G_2$. Since $U$ is the image of $f$, hence a subgroup, $U=G_2$, and $f$ is surjective.
My question is, how does the Inverse function theorem come into play? I know that the IFT for manifolds says that if $df_p\colon T_pM\to T_{f(p)}N$ is invertible, then there exist connected nhbds $U\ni p$ and $V\ni f(p)$ such that $f|U\colon U\to V$ is a diffeomorphism. I don't see how we can apply it if $df_e$ is just known to be surjective.
If $df_e:T_eG_1\rightarrow T_eG_2$is surjective map(or equivalently $\text{rank}_ef=\dim G_2$, or $f$ is a submersion at $e$), then by using $L_g$ of $G_1$ and $L_{f(g)}$ of $G_2$, we can get the conclusion $df_g:T_gG_1\rightarrow T_{f(g)}G_2$is surjective map(or equivalently $\text{rank}_gf=\dim G_2$, or $f$ is a submersion).
Now from the Lemma, $f(G_1)$ is open in $G_2$.
Since $f(G_1)$ is open in $G_2$, we get the conclusion $f(G_1)$ is closed in $G_2$.