How to show that $G$ can be expressed as a semidirect product Let $G$ be a group of order $42$. Prove that $G$ is a semidirect product of a normal subgroup of order $21$ and $\mathbb{Z}_2$.
My attempt: $G$ has unique Sylow 7 subgroup and Sylow 3 subgroup is not unique (as $n_3 = 1$ (mod $3)$ and $n_3 | 14$, $\implies n_3 = 7$?), and so the Sylow 3 subgroup is not normal (if it were, we could just take the product of Sylow 7 and Sylow 3), so I'm not sure how to construct a normal subgroup of order 21. 
As far as construction of an explicit homomorphism goes $\phi: \mathbb{Z}_2\rightarrow Aut(S)$, where $S$ is the normal subgroup of $G$ of order 21, $\phi(0) = id_S$ and $\phi (1)$ is the automorphism that sends each element to its conjugate as stated in the answer. 
Also, how can we prove that elements of odd order form a subgroup of index 2 as suggested in the answer. Thanks.
 A: 
My attempt: $G$ has unique Sylow 7 and Sylow 3 subgroups which are normal

No, the 3-subgroup does not have to be normal. There is a non-abelian group of order $21$, in which $14$ elements have order $3$.
Once you can construct a subgroup $H$ of order $21$, the rest is easy. There is an element $x$ of order $2$, which is not in that subgroup. Look at how $x$ acts on $H$ by conjugation. That's the explicit homomorphism.
That leaves the unresolved part - finding an index-2 subgroup.
Consider the action of $G$ on itself by (left) multiplication as a permutation - the Cayley homomorphism $\pi$. For an element $x$ of order $k$, the cycle representation of $\pi(x)$ consists entirely of $k$-cycles. If the number of elements in $G$ is twice an odd number and $k$ is even, then that will be an odd number of even cycles - which makes it an odd permutation. The intersection of $\pi(G)$ with the alternating group form a subgroup of index $1$ or $2$ in $\pi(G)$ - and, since we've found an odd permutation $\pi(x)$ for some $x$ of order $2$, said intersection can't be all of $\pi(G)$.
The homomorphism $\pi$ is injective, so after pulling back $\pi^{-1}(A_G\cap \pi(G))$ is a subgroup of $G$ of index $2$. It consists exactly of the elements of odd order in $G$. We proved this for any order that's twice an odd number, and $42-2\cdot 21$ certainly qualifies, so we're done.
Thanks to Jyrki Lahtonen for this argument constructing the subgroup of index 2.
