The question says,
Let $ g_1, g_2, g_3 ... g_n$ be representatives of all the distinct conjugacy classes of a finite group $G$, such that these elements pairwise commute. Prove that $G$ is abelian.
I just want my proof to get verified, as this is really simple, I'm a little sceptical about it.
Proof:
Let $C_G(g_i)$ be the centraliser of the element $g_i$. Since it is given all the $g_i$'s pairwise commute, we have $$ C_G(g_1) \cap C_G(g_2) \cap ... \cap C_G(g_n) \supset \{g_1, g_2, g_3 ... g_n\} $$.
Let us assume $|G|=N$. Since we have $|C_G(g_i)| \geq n, \forall i \in \{1,2,...,n\}$, from the class equation we have
$$ |G| = \sum_{i=1}^n{|G : C_G(g_i)|} $$ or, $$ N \geq \left( \frac{N}{n}\right) .n$$
and the equality holds iff $|C_G(g_i)|=n \forall i \in \{1,2,...,n\}$ .
Thus we have, $C_G(g_i)=\{g_1, g_2, g_3 ... g_n\} \forall i \in \{1,2,...,n\}$.
However, from the class equation, we have $C_G(g_i)=G$ for at least one $g_i$, which belongs to the centre of the group $Z(G)$.
Hence $G= \{g_1, g_2, g_3 ... g_n\}$ and the group is abelian (Proved).
Is it all right or am I missing something?
Consider $$N=\sum_{i=1}^n [G:C_G(g_i)]$$ The point here is that since $[G:C_G(g_i)]$ is at most $\frac Nn$ and there are $n$ terms, each term must be exactly $\frac Nn$, otherwise the two sides of the equation could not be equal. But the identity element (which must be one of the $g_i$) is centralized by the whole group, so $\frac Nn=1$, hence each conjugacy class consists of only one element and the group is abelian.