Prove that for all p, there exists a non-abelian group of order p^3.

Using the conjugacy class equation: i want to show that there exists a non-abelian group of order . I know that and since i want a non-abelian group, or . If |Z(G)| = p^2, then |G/Z(G)| = p but then that would mean G/Z(G) is cyclic with order p which cannot be since G/Z(G) is never a nontrivial cyclic group. therefore |Z(G)| = p. likewise each [G: C(x)] must be either p or p^2 since if it was then |C(x)| = 1 which contradicts the definition of the class equation, and if the index = 1, then |C(x)| = which means Z(G) = G. Then i say that each [G: C(x)] = p and if there are of them, then which is the correct order of the group. But also, if each [G: C(x)] = p^2, and if there are p-1 of them, then which is also the correct order.

i am having trouble with the last part, since it seems like since we have a sum, a bunch of the [G: C(x)] can be p while a bunch of other could be and when you add them all together and add them to we might somehow get . in other words, there doesn't seem to be a reason why each conjugacy class must have the same number of elements. although i assumed so to simplify things and to check that it worked, i don't know how to deal with the case if not all of the conjugacy classes are the same order. Could someone help fix up the end of my proof? thanks.

Re: Prove that for all p, there exists a non-abelian group of order p^3.

This may not be what you are looking for, but a simpler way to prove the existence of a nonabelian group of order would be to give an explicit construction of such a group, for example the Heisenberg group over the field of p elements.

Re: Prove that for all p, there exists a non-abelian group of order p^3.

Or, to say what is more general true if you can factor as where then you have a non-trivial homomorphism and thus have a non-trivial, and so nonabelian, semidirect product of order . So, in your example, since and there exists nontrivial homomorphisms and so nontrivial (thus nonabelian) semidirect products o order --this is precisely what Deveno said.

This all said, I like Opalg's solution the best, since not only does it give a succinct answer but should get one acquainted with the ubiquitous Heisenberg group.

Re: Prove that for all p, there exists a non-abelian group of order p^3.

for the homomorphism f to be well defined, doesn't the order of the element that [1] maps to have to divide ? i'm confused on why and how that implies that f is a well defined homomorphism. is this a general result or does this only occur for the specific groups that you guys mentioned?