I'm studying Abstract Algebra, 3rd Edition by Dummit and Foote. In Section 4.4 (Automorphism), one of the examples proves that $G$ is abelian if both of the following hold.
- $|G| = pq$ where $p$ and $q$ are primes (not necessarily distinct) with $p \le q$
- $p \nmid q-1$
The second part of the proof further assumes $Z(G) = 1$ and states
- every nonidentity element of $G$ has order $p$ $\implies$ $C_G(g)$ has index $q$ for all nonidentity $g \in G$
The proof next states that, if the right-hand side of #3 is true, then the class equation for $G$ reads $pq = 1 + kq$, which is impossible. Therefore, the proof states, there must exist $x \in G$ with order $q$.
Question: Why is #3 true?
Attempt 1
Let $x$ be a nonidentity element of $G$. $C_G(x)$ is a subgroup of $G$. Because cosets of a subgroup partition $G$, and each coset is of the same size, if we can say $|C_G(x)| = p$, then it must be the case that $C_G(x)$ has index $q$.
$x$ commutes with any $x^i$ where $i \in \mathbb{Z}$, so $x^i \in C_G(x)$. Additionally, $x, x^2, ..., x^{p}$ are all distinct because $|x| = p$. Therefore $C_G(x)$ is of size at least $p$, containing $x, x^2, ..., x^p$.
Now assume $y \in C_G(x)$ where $y \ne x^i$ for any $i \in \mathbb{Z}$. This should lead to a contradiction... (but how?)
Attempt 2
For any $g \in G$, there is a bijection between the elements of $G/C_G(g)$ and the elements of the conjugacy class of $g$. Therefore, for any nonidentity $x \in G$, if we can show that the size of the conjugacy class of $x$ is $q$, it follows that $C_G(x)$ has index $q$... (but how do we show that?)
To your attempt $1$: suppose $|C_G(x)|>p$. Since $\langle x\rangle$ is a subgroup of $C_G(x)$ of order $p$ it is obvious from Lagrange's theorem that $|C_G(x)|=|G|$ and hence $C_G(x)=G$. So $x$ commutes with all elements in $G$ and hence $x\in Z(G)$ which is a contradiction to the center being trivial.