Let with primes and nonabelian. The Sylow theorems give and , so and the Sylow -subgroup is normal. Also and . If , both Sylow subgroups are normal and is their abelian direct product, a contradiction. Hence , and
Because is abelian, the commutator subgroup lies in . It is nontrivial because is nonabelian, and is prime, so . Therefore
and has exactly linear characters.
Every nonlinear irreducible degree divides . Its square is at most , so the only possibility is degree . If there are such characters, the sum of squares of irreducible degrees gives
The number of irreducible characters equals the number of conjugacy classes, so
These are the irreducible characters of a nonabelian group of order p q.