Problem
Let $G$ be a nonabelian group of order $p^{3},$ where $p$ is a prime. Show that $G$ has exactly $p^{2}+p-1$ distinct conjugacy classes.
Attempt
Let $G$ be a nonabelian group with $|G|=p^{3},$ where $p$ is a prime. Recall $|Z(G)|=p$ from the previous problem (1)[I've prove already]. By Class equation, \begin{equation} \label{5 - 1} p^{3}=|G|=|Z(G)|+\sum_{i=1}^{n}[G:C(a_i)]=p+\sum_{i=1}^{n}[G:C(a_i)], \end{equation} where ${\rm class~}a_1$, ${\rm class~}a_2$, $\cdots$, ${\rm class~}a_n$ are the nonsingleton conjugacy classes in $G$. It is enough to show that $n=p^2-1$.
Since $2 \leq\left[G: C\left(a_{i}\right)\right]=\frac{|G|}{|C(a_i)|}=\frac{p^3}{|C(a_i)|},$ we have $$ | C\left(a_{i}\right)|=1{\rm ~or~}p{\rm ~or~}p^2{\rm ~or~p^3} $$ for each $i=1,2,\cdots, n$. Note that $| C\left(a_{i}\right)|\neq 1$ for all $i$ since $G$ is nonabelian and $| C\left(a_{i}\right)|\neq p^3$ for all $i$ because $|Z(G)|=p$. Assume that there is $j \in N$ such that $|C\left(a_{j}\right)|=p$. Then $$ \left| \frac{G}{C(a_j)}\right|=\frac{|G|}{|C(a_j)|}=\frac{p^3}{p}=p^2. $$ Hence, $G/C(a_j)$ is abelian. Then -----??------, which is a contradiction. Hence, $|C\left(a_{i}\right)|=p^2$ for all $i$. ---------skip--------------
Question
- Am I approaching in the right way?
- If good, how to prove the '-----??------'.
Because $\mathcal Z(G)\subset\mathcal C(a_i)\neq G$ we must have $p$ $|$ $|\mathcal C(a_i)|$ $|$ $p^3$. Therefore $|\mathcal C(a_i)|=p^2$. $$\therefore p^3=p+np$$ $$\therefore n=p^2-1$$