Here is Prob. 9, Sec. 3.3, in the book Topics in Algebra by I.N. Herstein, 2nd edition:
(a) If the group $G$ has three elements, show it must be abelian.
(b) Do part (a) if $G$ has four elements.
(c) Do part (a) if $G$ has five elements.
I think I am clear on how to tackle Part (a).
And, this is my Mathematics Stack Exchange post on Part (b).
So here I will only be attempting Part (c).
My Attempt:
Suppose our group $G$ has five distinct elements, say, $e, a, b, c, d$, with $e$ being the identity element.
Now suppose, if possible, that $ab \neq ba$.
As the elements $e, a, b, c, d$ of $G$ are all distinct, so by virtue of the cancellation laws (i.e. Lemma 2.3.2 in Herstein), we cannot have $ab = a$, $ab = b$, $ba = a$, or $ba = b$.
Therefore we must $ab, ba \in \{ e, c, d \}$.
Since $ab \neq ba$ by our supposition, therefore without loss of generality we have the following two cases:
Case 1. Suppose that $ab = c$ [Or, we can also have $ab = d$.] and $ba = e$.
Thus our group $G$ has the five distinct elements $e, a, b, ab, d$.
Since $ba = e$, we also have $$ a = ae = a(ba). \tag{1} $$
However, since $G$ is a group, we must have $$ a(ba) = (ab)a. \tag{2} $$
From (1) and (2) above, we obtain $$ a = (ab)a, $$ from which we obtain $$ e = ab, $$ again by Lemma 2.3.2 in Herstein. This contradicts the fact that $e$ and $ab$ are two distinct elements of $G$. So our supposition that $ab \neq ba$ is wrong. Therefore we must have $$ ab = ba. $$
Case 2. Suppose that $ab = c$ and $ba = d$. [Or, vice versa.]
Then our group $G$ has the five distinct elements $e, a, b, ab, ba$.
By Lemma 2.3.2 in Herstein, $a^2$ cannot equal $a$ (for otherwise $a$ would equal $e$, which is contrary to our choice), nor can $a^2$ equal $ab$ or $ba$ (for otherwise $a$ would equal $b$, again contrary to our choice). So we must have $a^2 = b$ or $a^2 = e$. However, if $a^2 = b$, then we obtain $$ ab = aa^2 = a^3 = a^2a = ba, $$ which is contrary to our supposition that $ab \neq ba$. So we must have $a^2 = e$, which implies that $a^{-1} = a$. Similarly, we also have $b^2 = e$, which implies that $b^{-1} = b$.
Therefore we have $$ (ab)^{-1} = b^{-1}a^{-1} = ba. \tag{3} $$
Now consider $(ab)a$. By the closure property of our group $G$, $(ab)a$ must be one of the elements $e, a, b, ab, ba$. However we show in the following paragraphs that each of these possibilities leads to a contradiction.
We note that if $(ab)a = e$, then $(ab)^{-1} =a$, and thus from (3) above (and the uniqueness of the inverse of each element in a group) we obtain $ba = a$, a contradiction. So $$ (ab)a \neq e. $$
If $(ab)a = a$, then we obtain $ab = e$, a contradiction. So $$ (ab)a \neq a. $$
If $(ab)a = b$, then we obtain $$ ab = abe = aba^2 = [(ab)a]a = ba, $$ again a contradiction to our supposition that $ab \neq ba$. So $$ (ab)a \neq b. $$
If $(ab)a = ab$, then we obtain $a = e$, a contradiction. So $$ (ab)a \neq ab.$$
Finally, if $$ (ab)a = ba, $$ then we obtain $$ a(ba) = ba, $$ which implies $$ a = e, $$ a contradiction. So $$ (ab)a \neq ba.$$
Thus we have shown that, in either of Cases 1 and 2 above, our supposition that $ab \neq ba$ has led to contradictions. So we must have $$ ab = ba. $$
An analogous argument yields $bc = cb$, $bd = db$, $ac = ca$, $cd = dc$.
Thus any two of the elements $a, b, c, d$ of $G$ commute. And, the identity element $e$ of course commutes with itself as well as with each of $a$, $b$, $c$, and $d$.
Hence our group $G$ is indeed abelian.
Is this proof correct? If so, is it rigorous enough for Herstein? Or, are there problems and issues?