I'm wondering if by knowing the center $Z(G)$ as well as $G/Z(G)$ one can
deduce G.


I thought that you should be able to write $G=Z(G) \times G/Z(G)$, because every
element either lies in the center or it does not, and central elements can
always be "separated" from the rest by commuting e.g. to the left.
Yet a bit of experimenting with GAP has shown that this is clearly not true,
however I don't see my mistake and would be very grateful if anyone could point it out to me.



Does the knowledge of $Z(G)$ and $G/Z(G)$ give the full group?
No, the knowledge of $Z(G)$ and $G/Z(G)$ usually doesn't give $G$. As an example, the quaternion group $Q\_8$ and the dihedral group $D\_8$ have both center $\mathbb{Z}/2$ and quotient $\mathbb{Z}/2 \times \mathbb{Z}/2$.


The problem with your argument is that if $z$ is central, it may be of the form $z=g^n$ with a non-central $g$. Such a $g$ can't be factored into a central part and a non-central part. 


