On the centres of the dihedral groups 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$)?
 A: I like your questions.


*

*Yes, and it is very silly.

*No, for example the quaternion group of order 8 is not like this.

*(So, there is no such H).
To be clear, the dihedral group of order 8k+4 is isomorphic to the direct product of a cyclic group of order 2 with a dihedral group of order 4k+2, but all other dihedral groups are "directly indecomposable", that is, they do not have a decomposition as a direct product of two non-identity groups.
In case you want to prove the stronger indecomposability:  Basically, you look at the normal subgroups.  Assuming the order of the dihedral group is at least 6, they are all contained in the subgroup of rotations, and so the only way you can have a direct product is if that subgroup of rotations has order 4k+2, so that its Sylow 2-subgroup is centralized by a flip.
A: Question 1. The proof is a correct proof that the original assertion (that for $n$ even you have $D_{2n}\cong C_2\times D_n$) is false. Indeed, you can simply do it with $n=4$: $D_4$ is abelian, the Klein $4$-group; $D_8$ is not abelian, but $C_2 \times D_4$ is abelian, so $D_8$ cannot be isomorphic to $C_2\times D_4$. The assertion about $D_{2n}$ is false.
Question 2. No, it's not true in general. Take a nonabelian group of order $p^3$; then $Z(G)\cong C_p$. If you had $G\cong Z(G)\times H$, then $H$ would be of order $p^2$, hence abelian, so $G$ would be abelian (a product of two abelian groups).
Question 3. Moot. 
A: A comment about the assertion (first question).
"when n is even then $D_{2n}\cong C_2 \times D_{n}$". 
This looks to be not true: consider a special class of dihedral groups namely $2-$groups, i.e. dihedral groups of order $2^n$, with $n\geq 3$. These are non-abelian $2-$ groups. As you said, their centers are non-trivial (should be; it is true for any p-group); the center of the dihedral group $D_{2^n}$ of order $2^n$ is $C_2$. 
But by Sylow-theory, it should intersect with every normal subgroup of $D_{2^n}$ non-trivially, hence should be contained in that normal subgroup(as center has order 2); in particular the center must be contained in every maximal subgroup of $D_{2^n}$, and hence in particular, it should be contained in subgroups isomorphic to $D_{2^{n-1}}$.
Therefore, $D_{2^n}$ can not be (internal) semidirect product of $C_2$ by $D_{2^{n-1}}$.; hence in particular it can be direct product of $C_2$ by $D_{2^{n-1}}$.
[Another simple argument can be given: if for $n$ even, $D_{2n}\cong C_2 \times D_{n}$, then in particular we should have (by induction)
$D_{2^n} \cong C_2 \times D_{2^{n-1}} \cong C_2 \times (C_2 \times D_{2^{n-2}})\cong \cdots \cong C_2 \times C_2 \times \cdots \times D_4$, which is elementary abelian $2$-group, contradiction.
Already very simple answers given above to second and third question, so nothing to add more.]
