A strange result if $|G/\mathrm{Z}(G)|=p$ I came across something strange, which I would like to share.
Let's take a group $G$ such that $|G/\mathrm{Z}(G)|=p$, where $p$ is a prime number. 
Then, we can show that $G$ is abelian $\iff \mathrm{Z}(G)=G$. 
But then $|G/\mathrm{Z}(G)|=|G/G|=1$ and we have a contradiction.
What do I miss?
Thanks

We have that if $G/Z(G)$ is cyclic then $G$ is abelian. But since $G$ abelian means $G=Z(G)$, this forces $|G/Z(G)|=1$. Now, if $|G/Z(G)|$ were a prime number then $G/Z(G)$ would be cyclic and then $|G/Z(G)|$ would be 1, which is impossible. Hence we can never have $|G/Z(G)|$ prime. We have proved that either $G$ is abelian or $|G/Z(G)|$ has at least two prime factors (which may be equal).
