Question: Prove that every group of order p^2 (where p is a prime) is abelian.
What I started to say was this:
|G| = p^2, then |G/Z(G)| = |G|/|Z(G)| which can equal p^2, p or 1, since those are the divisors of p. If |G/Z(G)| = p, then G/Z(G) is cycic because one element has order 1 and the rest of order p, which means there is a generator, it is cyclic and then G is abelian.
If |G/Z(G)| = 1, then G=Z(G) so it much be abelian. However, the case where |G/Z(G)|=p^2 is where I get a little hung up. I know it never happens, but how can i prove it?