I'm having trouble understanding the following example:
Let $p$ be prime and $G$ a group of order $p^3$. Then either $G$ is abelian or $G/Z(G)$ is abelian (or both). The reason for this is that the centre of a $p$ group is always nontrivial. Therefore $G/Z(G)$ has order $1, p$ or $p^2$ and so is abelian.
I understand that $G/Z(G)$ has order $1, p$ or $p^2$ but I don't understand why this means it is abelian? Of course if it has order one it is abelian and this means $G$ is also abelian. Also for $p^2$ this means that $G/Z(G)$ is abelian as all groups of order $p^2$ are abelian, but what does this tell us about $G$? That $G$ is not abelian?
What I am most confused about is how if $G/Z(G)$ has order $p$, how does this imply it is abelian? I understand that if $G/Z(G)$ has order $p$ then since it is cyclic, $G$ is abelian.. but this doesn't imply the whole quotient is abelian does it?? is it because the cyclic order of the quotient implies $G$ is abelian and therefore the quotient is too? If so does this mean we can change the proposition:
"Let $G$ be a group such that $G/Z(G)$ is cyclic. Then $G$ is abelian."
to the following:
"Let $G$ be a group such that $G/Z(G)$ is cyclic. Then $G$ and $G/Z(G)$ is abelian."