Prove that any group $G$ of order $p^2$ is abelian, where $p$ is a prime number 
Possible Duplicate:
Showing non-cyclic group with $p^2$ elements is Abelian 

"Let $p$ be a prime number. Prove that any group $G$ of order $p^2$ is abelian. You may assume the fact that the centre of a $p$-group is non-trivial".
I understand from the question is that the group $G$ is a $p$-group, with $p^2$ number of elements in it (meaning it is finite). Also, the centre, i.e the set of elements where $g_1g_2 = g_2g_1$ for all $g_1, g_2 \in G$, is non-trivial, meaning $\neq e$.
So, the non-trivial bit shows that the center, $Z$, either generates the group, so it's cyclic and therefore abelian by definition. Or, it generates a subgroup of order p, and so $Z$ with some elements missing from group $G$ generate G, but as these groups commute (because they have a centre of $Z$), we can say the group is abelian.
Is this correct? 

The center of a p-group can't be trivial. If $Z(G)=p^2$ then we are done. If $Z(G)=p$ then $G/Z(G)$ has order p and is cyclic. Thus, G is abelian using the G/Z theorem.
