Prime power order implies not centerless

Statement

Any group of prime power order which is nontrivial has a nontrivial center.

Proof

The key ingredient for the proof is to consider the action of the group on itself by conjugation (i.e. inner automorphisms) and use the class equation to show that:

$|G| \equiv |Z(G)| \mod p$

Since both are groups of order a power of $p$, the group being nontrivial is equivalent to the center being nontrivial -- either means that the two sides of the congruence are 0 mod $p$.