A group whose all elements are of order 1 or 2 is Abelian. 
Suppose you have $(G, \cdot)$a group whose all elements are either of order $1$ or $2$. Show that it's abelian.

My proof, suppose you have $a,b \in G$ such that $a^1 = e$ and $b^1 =e$ then:
$$a \cdot b= e \cdot e = b \cdot a$$
Now suppose we have $a^1 = e$ and $b^2 = e$:
$$a \cdot b = e \cdot b  = b \cdot e = b \cdot a$$
And finally suppose $a^2 = e$ and $b^2 = e$ then:
$$a \cdot b = a \cdot ( a^{-1} \cdot a ) \cdot b = (a^{-1})(a^2)b=a^{-1}b$$
and $$ b \cdot a = b  (b^{-1} \cdot b ) a = b^{-1}(b^2)a = b^{-1}a$$
Thus we have $$(a\cdot b)(b\cdot a)= (a^{-1} \cdot b)(b^{-1} \cdot a)= e$$
Thus $ab=ba$. 
Is my proof correct?  
 A: Your first two cases are a little inelegant, since $a^1 = e$ means that $a=e$.  So the property that every element is of order 1 or 2 can be simplified to requiring $$x^2 = e,\; \forall  x \in G.$$
Here is a streamlined version.  Let $a, b \in G$ and let $x = ab$.  Since $x^2 = e$, we have
$$
    abab = e
$$
Multiply on the right by $b$ and remember that $b^2 =e$ to get
$$
    aba = b
$$
Multiply on the right by $a$ and remember that $a^2 =e$ to get
$$
    ab = ba
$$
A: It appears that OP John Mayne's questions about his attempt have been sufficiently addressed by other users; the key, I think, is to realize that $g^2 = e \Longleftrightarrow g = g^{-1}$, viz:
The condition
$\forall g \in G (g^1 = e \vee g^2 = e) \tag 1$
is logically equivalent to 
$\forall g \in G (g^2 = e), \tag 2$
since
$(g^1 = e \Longleftrightarrow g = e) \tag 3$
and
$g = e \Longrightarrow g^2 = e; \tag 4$
therefore we need to show
$\forall g \in G (g^2 = e) \Longrightarrow \forall a, b \in G (ab = ba). \tag 5$
Now
$\forall g \in G (g^2 = e \Longleftrightarrow g^{-1}g^2 = g^{-1}e \Longleftrightarrow g = g^{-1}); \tag 6$
thus
$\forall a, b \in G (ab = a^{-1}b^{-1} = (ba)^{-1} = ba). \tag 7$
