Solution (source code)

= Solution

Let $|G|=p^2$. By <irreducible character degree divides the group order>, each irreducible degree divides $p^2$. A degree is at most $\sqrt{|G|}=p$ by the <sum of squares of irreducible degrees>. If a degree $p$ occurred, its square would already consume the entire sum $p^2$, leaving no room for the trivial character. Hence every irreducible degree is one. A finite group has only linear irreducible characters exactly when it is abelian, so \b[every group of order $p^2$ is abelian.]