I didn’t see the similar question. My question isn’t a duplicate because I understand how to prove this. But I don’t understand where the hint comes from. That question doesn’t flesh it out.
Pretend the question didn’t give the hint. How can you prognosticate (please see my profile) to Consider $(a*b)*(a*b)$? This trick is too magical and superhuman. I didn’t see it.
The other trick is to write $e *e = (a*a)*(b*b)$. How can you prognosticate this?
A key idea is clearer this way: $\ x\cdot x = e\,\Rightarrow\, x \color{#c00}{\overset{(1)}=} x^{-1}\, $ so $\ ab \color{#c00}{\overset{(1)}=} \color{blue}{(ab)^{-1}}\! \color{#0a0}{\overset{(2)}=} b^{-1} a^{-1}\! \color{#c00}{\overset{(1)}=} b a\ \ \,$ QED
Now it is clearer where the proof “comes from”, namely it arises by “overlapping” the identities $x\! \color{#c00}{\overset{(1)}=} x^{-1}$ and $\,(xy)^{-1}\color{#0a0}{\overset{(2)}=} y^{-1} x^{-1}$ i.e. by discovering some term $\,\color{blue}{(ab)^{-1}}\!$ where both identities apply. Then, just as we did above, we can rewrite the term in two ways, giving a possibly new equality.
This is a widely applicable method of deriving consequences of identities, i.e. by “unifying” terms of both so that both identities apply. In fact in some cases it can be used to algorithmically derive all of the consequences, so yielding algorithms for deciding equality, e.g. see the Knuth-Bendix equational completion algorithm and the Grobner basis algorithm, and see George Bergman’s classic paper The Diamond Lemma in Ring Theory.
Let $G$ be a group, to show it is abelian is the same as to show that for $a,b\in G$, one has $ab=ba$, which is the same as $aba^{-1}b^{-1}=e$.
Now in this specific group, $a^{-1}=a$ and $b^{-1}=b$, so the last equation becomes $(ab)(ab)=e$. That is why we consider $(a*b)*(a*b)$.
We are just given that $x^2=e$ for all $x\in G$. I am not a superhuman and right now I am guessing and wanting just to manipulate the elements. You want to see $ab=ba$ for all $a,b\in G$. Let’s multiply both sides from the right(or left) by $ab$ for example. We get: $$(ab)*(ab)=(ab)*(ba)$$ Since $(ab)^2=e$, so $$(ab)*(ba)=e\to a*b^2*a=e\to e=e$$ This is a good point to start and we understand why the first key was given to us. That’s it.
To break down BS’s answer even more: I want to show that $ab=ba$ for every two elements $a$, $b$. This identity looks kind of awkward, so I’m going to peel terms off of one side. First, let me multiply on the left by $a^{-1}$ (or, since I know that $a^{-1}=a$, by $a$): $aab=aba$, or $b=aba$. Progress! But I’m still not done, so let’s multiply both sides on the left by $b$. Well, this gives me $bb=baba$, or $e=baba$. But this last is $e=(ba)(ba)$, and I can see that that’s an identity because of the group’s definition; this must mean that my original statement, $ab=ba$, was also an identity, and so the group is abelian.