TITLE: Let $G$ be a group such that $a^2 = a$ for all $a \in G$, Is $G$ an abelian group?
QUESTION [5 upvotes]: I tried to solve this by following:

Since $G$ is a group, an inverse exists for every element in $G$.
Multiply by inverse to $a$ on both sides of $a^2 = a$.
We will get $a = i$, where $i$ is the identity element.
This holds true for all $a*$, which implies $G$ contains only one distinct element i.e. $i.$
Hence $G$ is abelian.

Is my approach correct?

REPLY [2 votes]: Yes, I think you are right.
Also, we can get the following.
$$abab=ab$$ 
gives $$aba=a,$$
which gives $$ab=ba=e.$$
Done!