TITLE: Every group of order $p^5$ is metabelian
QUESTION [11 upvotes]: How to show that for $p$ prime, every group of order $p^5$ is metabelian? A group is metabelian if and only if its commutator subgroup $G'$ is abelian.
If $G$ is a group of order $p^5$, then $G$ has a normal subgroup $N$ of order $p^3$ (in $p$-groups, there is a normal subgroup of every possible order). Then $G/N$ is abelian and thus $G' \leq N$. Therefore the commutator subgroup has order $1$, $p$, $p^2$ or $p^3$. The only case where $G'$ could be nonabelian is when it has order $p^3$. This actually happens when $G = D_{32}$, the dihedral group of order $32$, so proving that $|G'| = p^3$ is impossible is not the way to go.
Any ideas where to go from here?

REPLY [7 votes]: Let $G$ be a group of order $p^5$.
Claim: $G$ has abelian normal subgroup of order $p^3$.
Since any finite $p$-group has normal series (series of normal subgroups); consider a normal series $1\triangleleft H \triangleleft K\triangleleft \cdots \triangleleft G$, where $|H|=p$, $|K|=p^2$. Then $K$ is an abelian normal subgroup of order $p^2$. The normality of $K$ implies that $G$ acts on $K$ by conjugation: $(g,k)\mapsto gkg^{-1}$. This gives a homomorphism $\varphi\colon 
G\rightarrow Aut(K)$, $g\mapsto \{\varphi_g\colon k\mapsto gkg^{-1}\}$,
and $ker(\varphi)$ continas those elements of $G$ which commute with all elements of $K$.
Now, $K\cong C_p\times C_p$ or $C_{p^2}$; hence $|Aut(K)|\in \{p(p-1)(p^2-1), p(p-1)\}$. We see that $|Im(\varphi)|\in \{1,p\}$ (since $G$ is $p$-group), i.e. $[G\colon ker(\varphi)]\leq p$. Therefore, 
$|ker(\varphi)|\geq p^{4}> p^3$. Consider the normal series 
$1 \triangleleft H\triangleleft K\triangleleft  ker(\varphi)\triangleleft G$, and take a refinement $1 \triangleleft H\triangleleft K\triangleleft L\triangleleft \cdots \triangleleft  ker(\varphi)\triangleleft G$, where $|L|=p^3$. Then $L$ is abelian (why?) normal subgroup of order $p^3$. Can you see that $G$ is meta-abelian?