Is a group of prime-power order always abelian? Let $G$ be a group of order $p^n$, with $p$ prime. By Sylow's first theorem, there exists at least one  subgroup of order $p^n$ (the number of subgroups of order $p^i$ is $1$ mod $p$ per $i$). The subgroups with order $p^n$ are all Sylow-$p$ groups.
Now, by Sylow's third theorem, because the group is of order $p^n$, the number $m_{p^{n}}$ of such subgroups must divide $\#G/p^n =1$, and only $1$ divides $1$, so there is only one subgroup of order $p^n$.
By Sylow's second theorem, all Sylow-$p$ groups are conjugated to each other by at least one element $g\in G$, so, for any $S$ and $S'$, we have $S=gS'g^{-1}$. In this case, there is only one Sylow-$p$ group, so it is conjugated to itself.
Of course, that one subgroup is the group itself. We now have $gG=Gg$ for some $g$ in $G$. Can we get to the entire group being abelian, from here?
I ask because my textbook on Abstract Algebra states that any group of order $p^2$ is abelian, and I'm curious whether it generalises.
Edit: As has been pointed out, everything I've proved above is quite trivial. Below it is discussed that the essential question is actually "How does one prove that groups of order $p^2$ are abelian using Sylow theory?", since my textbook explicitly mentions this property as an application of Sylow's theorems.
Edit 2: One of the authors has confirmed that they accidentally mixed some classic classification theorems into the list of applications of Sylow theory, and that this was one of them.
 A: It doesn't generalise -- the dihedral group with $8$ elements is an example, and a more general one is the set of matrices $$\begin{bmatrix} 1 & x & y \\ 0 & 1 & z \\ 0 & 0 & 1 \end{bmatrix}$$ with $x,y,z \in \mathbb{Z_p}$.
For a group of order $p^2$, the most common way to prove that it is abelian is to look at its center, $Z(G)$, the set of terms which commute with every other term. The center has to be nontrivial: if you consider the conjugacy classes of $G$ on itself, each must be of size $p^k$ for some non-negative $k$. But the conjugacy class of $e$ is trivial, and thus there exist at least $p-1$ other such cases.
Suppose the center has size $p$. Then $G/Z(G)$ must be a cyclic group on $p$ elements, and thus $G$ must be abelian. (for any group $H$, if $H/Z(H)$ is cyclic then $Z(H)=H$).
A: You can construct a nonabelian group of order $p^n$, for $p$ an odd prime, $n\gt2$,  by selecting a nontrivial homomorphism $\varphi:\Bbb Z_p\to\rm{Aut}(\Bbb Z_{p^{n-1}})\cong\Bbb Z_{p^{n-1}-p^{n-2}}$.  Let $G=\Bbb Z_{p^{n-1}}\rtimes_\varphi\Bbb Z_p$.
If, on the other hand, $p=2$, consider dihedral groups.
A: A group of order $p^n$ is always nilpotent. This is a natural generalisation of abelian. The examples of $Q_8$ and $D_4$ of order $8$ are nilpotent but non-abelian. The group of upper-unitriangular matrices over $\Bbb F_p$ is the Heisenberg group, which is $2$-step nilpotent, and also non-abelian.
Reference:
Prove that every finite p-group is nilpotent.
