I was studying some properties of semidirect products, and I noticed this sentence on Wiki
Suppose $G$ is a semidirect product of the normal subgroup $N$ and the subgroup $H$. If $H$ is also normal in $G$, or equivalently, if there exists a homomorphism $G\to N$ which is the identity on $N$, then $G$ is the direct product of $N$ and $H$.
So I tried proving myself that having such homomorphism from $\varrho \colon G\to N$ which is the identity on $N$ was sufficient to imply $H$ normal (because I think this is the point) and so having two normal subsets $H,N$ with $H\cap N=1$ it's easy to see that $G\cong N \times H$.
The problem is that I'm not able to prove that $\ker \varrho=H$ (either the two implications).
Being $\varrho$ surjective I tried considering the iso $G/\ker \varrho \to N$, but I do not know how to prove that $H \subset \ker \varrho$. In fact I proved that, for every $g \in G$, exists $n \in N$ such that $[g]=[n]$, but from this I do not know how to proceed further, because I'd have $h w=n$ for $w$ element in the kernel. But to apply the fact that the intersection is trivial I need to know that the kernel is contained in $H$, which I cannot prove.
Can someone help me please? because this fact seems a triviality but it's bugging me