If $G/Z(G)$ is abelian, does $G$ have to be abelian? If $G/Z(G)$ is abelian, does $G$ have to be abelian ?
$Z(G)$ is the centralizer of G, i.e. $$Z(G)=\{h \in G \ \ | \ \  hg=gh \forall \ \ \  g\in G\}$$
Thanks for your help in advance
 A: Hint:what about quaternion group of order 8?
A: Note that if $G/Z(G)$ is abelian, the the commutator subgroup $G'$ is abelian, since in this case $G' \subseteq Z(G)$. If $G/Z(G)$ is cyclic, then $G$ is abelian.
A: Claim Let $G$ be a nonabelian group of order $p^3$, $p$ a prime. Then $G/Z(G)\simeq C_p\times C_p$, in particular $G/Z(G)$ is abelian. Moreover $Z(G)=G'$.
Proof Since $G$ is a $p$-group, its center is nontrivial. Since $G$ is not abelian, $Z(G)\neq G$. Now $Z(G)$ cannot have cardinality $p^2$, since then $G/Z(G)$ must be cyclic and this forces $G$ to be abelian, which is impossible. Hence $Z(G)$, being nontrivial, has order $p$. It follows that $G/Z(G)$ has order $p^2$, so it is either $C_{p^2}$ or $C_p\times C_p$. But it cannot be cyclic. Since $G/Z(G)$ is abelian, $Z(G)$ contains $G'$. But $G'$ cannot be trivial either, and since $Z(G)$ has order $p$, $Z(G)=G'$.
Claim There exist non-abelian groups of order $p^3$ for every prime $p$.
Proof See this. In particular, for $p=2$ we have $Q_8$ and $D_8$; so the claim above gives $Q_8/Z(Q_8)=D_8/Z(D_8)=V_4$.
ADD I see now the argument I gave above is reproduced in Conrad's notes. I will leave it here for reference.
