Group $G$ whose center $Z(G)$ is cyclic and with $G/Z(G)$ commutative I have some issue to solve following exercise. The exercise is from a French book on Algebra (cours d'Algèbre) from Jean Querré. The book is from the 1970's.

If the center $Z(G)$ of a group $G$ is cyclic and $G/Z(G)$ is commutative then there exists a group $H$ such that $H \times H$ is isomorphic to $G/Z(G)$.

 A: This answer is almost complete and I think (read hope) that it's correct up to the point where I get stuck. (I've posted this as an answer because it's too long for a comment and I should go to bed.)

It suffices by the first isomorphism theorem to find a group $H$ and a surjective homomorphism $\theta : G \to H \times H$ for which $\ker \theta = Z(G)$.
By spelling out the definitions it is easy to see that $G/Z(G)$ is commutative if and only if $g^{-1}h^{-1}gh \in Z(G)$ for all $g,h \in G$, which occurs if and only if $[G,G] \le Z(G)$, where $[G,G]$ is the commutator subgroup of $G$.
This implies that the map $G \to [G,G]$ defined by $x \mapsto g^{-1}x^{-1}gx$ is a homomorphism for fixed $g \in G$, since if $y \in G$ then
$$\begin{align}
(g^{-1}x^{-1}gx)(g^{-1}y^{-1}gy) &= g^{-1}(x^{-1}gxg^{-1})y^{-1}gy \\
&= g^{-1}y^{-1}(x^{-1}gxg^{-1})gy \\
&= g^{-1}y^{-1}x^{-1}gxy \\
&= g^{-1}(xy)^{-1}g(xy)
\end{align}$$
Likewise the map $x \mapsto x^{-1}h^{-1}xh$ is a homomorphism for fixed $h \in G$.
Since $Z(G)$ is cyclic, so is $[G,G]$, and hence it is generated by a single element $g^{-1}h^{-1}gh$ for some $g,h \in G$.
Fix $g,h \in G$ such that $[G,G] = \langle g^{-1}h^{-1}gh \rangle$. Let $H = [G,G]$ and define $\theta : G \to [G,G] \times [G,G]$ by
$$\theta(x) = (g^{-1}x^{-1}gx, x^{-1}h^{-1}xh)$$
Now


*

*We know $\theta$ is a homomorphism by above remarks. 

*$\theta$ is surjective. Indeed, if $a \in [G, G] \times [G, G]$ then there exist $m,n$ such that
$$a = ( (g^{-1}h^{-1}gh)^m, (g^{-1}h^{-1}gh)^n )$$
But $\theta(h) = ( g^{-1}h^{-1}gh, 1 )$ and $\theta(g) = ( 1, g^{-1}h^{-1}gh )$, so
$$a = \theta(h)^m\theta(g)^n = \theta(h^mg^n)$$
hence $a \in \mathrm{im}\, \theta$.

*(This is where I get stuck.) We need to show that $\ker \theta = Z(G)$. The $\supseteq$ direction is obvious. For $\subseteq$, suppose $x \in \ker \theta$ and let $y \in G$. We need to show $xy=yx$. Well $x \in \ker \theta$ implies $xg=gx$ and $xh=hx$, so $x$ commutes with $g$ and $h$ (and their inverses). I'm sure a bit more hacking would yield $xy=yx$ but I haven't quite managed to do it. The fact that $x^{-1}y^{-1}xy \in [G,G]$ and hence $x^{-1}y^{-1}xy = (g^{-1}h^{-1}gh)^n$ for some $n$ should be useful.

