Isomorphism of G with product group $H \times N$. This is a question I attempted from a text book. And I would like to know how far I am correct in my arguments and thought process. 
Let $H$ be a subgroup of a group $G$, and let $\phi: G \to H $ be a homomorphism whose restriction to $H$ is the identity map:  $\phi(h) = h$ , if $h \in H$. Let $N = ker(\phi)$
(a) Prove that if $G$ is abelian then it is isomorphic to the product group $H \times N$.
(b) Find a bijective map $G\to H \times N$ without the assumption that $G$ is abelian, but show by an example that $G$ need not be isomorphic to the product group.
My attempt: 
(a) Aim is show a bijection and homomorphism between $G$ and $H \times N$.
Denote the isomorphism as $\psi :  H \times N \to G$
First looking at the homomorhism $\phi$, I see that it's surgective homomorphism since each element in the codomain $H$ is mapped at least to $H$ subgroup in $G$. 
We have $\phi: G \to H $, i.e., the the whole group has $H$ as it's image which is also the image of  $H$ subgroup in $G$. $\phi(H)=H$  and $\phi^{-1}(\phi(H))=G=NH$(also $=HN$ since $N$ is a normal subgroup). Thus $G = HN$ which assures the surgectivity of $\psi$
Next observation is that $H \cap N$ is $\{1\}$ since $\phi(h) = h$ , if $h \in H$. Consider elements $(h_1,n_1), (h_2,n_2)$ in $H \times N$ which have same image $h_1n_1=h_2n_2$ in $HN$. i.e.,  $h_1h_2^{-1}=n_1^{-1}n_2$. So, $h_1h_2^{-1}=n_1^{-1}n_2 = 1$. Hence $h_1=h_2$ and $n_1=n_2$.  Injectivy  of $\psi$ is shown.
Now consider the composition of two elements in $H \times  N$ $(h_1,n_1)$ and $(h_2,n_2)$, $(h_1h_2,n_1n_2)$. It's image in $G=HN$ would be $h_1h_2n_1n_2$ while the composition of individual products in $G$ would be $h_1n_1h_2n_2$. Since $G$ is abelian we say these are equal. Hence we have a homomorphism along with bijection making it isomorhism for $\psi: H \times N \to G$ .
(b) If $G$ is not abelian, we don't have homomorphism, but we still have bijection $\psi: H \times N \to G$ defined by  $\psi(h,n)=hn$
Please let me know if there are any incorrect/loose arguments. Thanks
 A: I don't see where you have defined $\psi$. I presume your intended map is:
$\psi(h,n) = hn$. I don't see how you establish this is surjective.
What I would do is this, define:
$\psi: G \to H \times N$ by $\psi(g) = (\phi(g), \phi(g)^{-1}g)$
It may not be clear the second coordinate is in $N$, so let's demonstrate:
$\phi(\phi(g)^{-1}g) = \phi(\phi(g^{-1}))\phi(g) = \phi(g^{-1})\phi(g) = \phi(e) = e$
(because $\phi(g^{-1}) \in \text{im }\phi = H$, and $\phi$ is the identity on $H$), so $\phi(g)^{-1}g \in \text{ker }\phi = N$.
Now we can establish bijectivity of $\psi$. Suppose $\psi(g) = \psi(g')$.
Then $\phi(g) = \phi(g')$, and $\phi(g)^{-1}g = \phi(g')^{-1}g'$.
So the second equation becomes: $\phi(g)^{-1}g = \phi(g)^{-1}g' \implies g = g'$.
On the other hand, it is clear that $\psi(hn) = (\phi(hn),\phi(hn)^{-1}(hn))$
$= (\phi(h)\phi(n),\phi(n^{-1})\phi(h^{-1})hn) = (h,\phi(n)^{-1}h^{-1}hn) = (h,n)$, so $\psi$ is surjective.
Now the question becomes: is $\psi$ a homomorphism?
$\psi(gg') = (\phi(gg'), \phi(gg')^{-1}gg') = (\phi(g)\phi(g'),\phi(g')^{-1}\phi(g)^{-1}gg')$.
IF $G$ is Abelian, then $\phi(g')^{-1}\phi(g)^{-1}gg' = \phi(g)^{-1}g\phi(g')^{-1}g$, and we continue:
$= (\phi(g)\phi(g'), \phi(g)^{-1}g\phi(g')^{-1}g) = (\phi(g),\phi(g)^{-1}g)(\phi(g'),\phi(g')^{-1}g'))$
$=\psi(g)\psi(g')$.
To show (b) you need a COUNTER-EXAMPLE.
Let $G = D_3 = \{e,a,a^2,b,ba,ba^2\}$, the dihedral group of order 6.
Let $H = \{e,b\}$ and $N = \{e,a,a^2\}$. Define $\phi: G \to H$ by:
$\phi(a^kb^j) = b^j$ for $k = 0,1,2, j = 0,1$. I leave it to you to prove this is, in fact, a homomorphism.
Clearly, we have $\phi|_H = \text{id}_H$, and $\text{ker }\phi = N$.
However, $H \times N$ is abelian (since both $H,N$ are), while $G$ is not, so $G \neq H \times N$.
