Example of a group where the quotient group with the center is nonabelian I am having a hard time coming up with a group such that $G/Z(G)$ is Abelian but $G$ itself is not. Is this true for any group such that the center contains only the identity?
Thanks!
 A: Consider the quaternion group $Q_8 = \{\pm 1, \pm i, \pm j, \pm k\}$, which is nonabelian, since $ij = k$ but $ji = -k$. Since $-1 \in Z(Q_8)$, $$|Q_8 / Z(Q_8)| = \frac{|Q_8|}{|Z(Q_8)|} \leq \frac{8}{2} = 4, $$ but every group of order $\leq 4$ is abelian. (Computing gives in fact that $Z(Q_8) = \{\pm 1\}$.)
The same argument applies to the dihedral group $D_8$ of order $8$. The only nonabelian group of order $\leq 8$ is $S_3$, but $Z(S_3) = \{1\}$, so $Q_8$ and $D_8$ (the only nonabelian group of order $8$) are the minimal examples.
A: $G/Z(G)$ being abelian is equivalent to the commutator subgroup $G' \subseteq Z(G)$ and the class of groups satisfying this property are exactly the nilpotent groups of class 2. Every finite nilpotent group is a direct product of its Sylow subgroups. Further, if the whole group has class $2$, so do each of its Sylow subgroups. Thus, every finite group of nilpotency class $2$ is obtained by taking direct products of finite groups of prime power order and class $2$. So, it suffices to study groups of prime power order and class $2$. Some non-abelian examples are:


*

*For the prime $p = 2$, dihedral group: $D_4$ and quaternion group are
two non-abelian groups of class two and order $8$.

*For odd primes $p$, there are two non-isomorphic groups order $p^3$ which are of nilpotent class $2$. See here for example.

