In an proof that I recently read, the following 'fact' is used, where $D_{2n}$ denotes the dihedral group of order $2n$:
If $n$ is even, then $D_{2n} \cong C_2 \times D_n$.
The (short) given justification is that the centre $Z(D_{2n}) \cong C_2$, whenever $n$ is even, and is trivial provided that $n$ is odd.
However, here is a result that a friend of mine found in the litterature which contradicts the previous one.
Suppose that 4 divides $n$. Then $D_{2n}$ is not isomorphic to $C_2 \times D_n$.
Proof: Suppose otherwise. We know that $Z(D_{2n}) \cong C_2$. By assumption, $D_{2n} \cong C_2 \times D_n$, therefore $Z(D_{2n}) \cong Z(C_2 \times D_{n})$. Since in a direct product $A \times B$, the groups $A$ and $B$ commute, we obtain that $Z(C_2 \times D_{n}) = Z(C_2) \times Z(D_n) \cong C_2 \times C_2$, a contradiction. QED.
Now comes my first question : Is the above proof correct?
Second question : Given a finite group $G$ whose centre is not trivial, does it always exist a group $H$ such that $G \cong Z(G) \times H$?
If so, then given $n$ a multiple of 4, the dihedral group $D_{2n}$ could be written as a direct product $C_2 \times H$. Here comes my third question : What should be $H$ since we know that it cannot have nontrivial centre (and, in particular, since $H$ cannot be $D_n$)?