Unable to use property of order $2$ elements to prove that groups with diagonal elements $=e$ are abelian. If $G$ is a group such that $x^2 = e$ for all elements $x$ in $G$, then show that $G$ is abelian. 
I wanted to propose a method, that is based on properties of order $2$ elements, that I observed is useful in doing exercises on filling partially filled tables.
The property is:
If any element $a$ has order $2$, then get two sets of equations, where $\exists x,y\in G$ :
1. $ax = y$
2. $ay = x$ 
So, $aay = y \mid aax = x \implies a^2 = 1$
Similarly, for the set of equations:
3. $xa =y$
4. $ya =x$ 
I thought that this approach could be used to construct an intuitive explanation, but facing problems as shown below:
Let there be a group table for $G$: 
\begin{array}{|c|c|c|c|c|}
\hline
* & e & a & b & c & d   \\ \hline 
e & e & a & b & c & d   \\ \hline 
a & a & e & x & y & z   \\ \hline 
b & b & x' & e & m & n   \\ \hline 
c & c & y' & m' & e & p   \\ \hline
d & d & z' & n' & p' & e   \\ \hline
\end{array}
To show it is an abelian group, need diagonal elements as equal.
For $cb = m'$, need show $bc = m = m'$.
Want to use the property stated earlier for order $2$ elements, and for that the last statement means:
$cb = m'$,
$m'b = c$
There is only one choice for $m'=d$, so:
$cb = d$,
$db = c$
\begin{array}{|c|c|c|c|c|}
\hline
* & e & a & b & c & d   \\ \hline 
e & e & a & b & c & d   \\ \hline 
a & a & e & x & y & z   \\ \hline 
b & b & x' & e & m & n   \\ \hline 
c & c & y' & d & e & p   \\ \hline
d & d & z' & c & p' & e   \\ \hline
\end{array}
but this means that $ab =a\implies b =e$.

So, where lies the mistake?

 A: The reason you can’t make it work is probably unknown to you at this stage. You are trying to construct a group with $5$ elements in which every element has order $1$ or $2$. However, no such group exists! As a consequence of Cauchy’s Theorem, in a finite group $G$, if a prime $p$ divides the order of the group $G$, then $G$ contains an element of order $p$. As a consequence of Lagrange’s Theorem, the order of any element of $G$ divides the order of $G$. And so if a finite group satisfies the condition that every element is of order $1$ or $2$, then the group must be of order $2^n$ for some $n\geq 0$. In particular, it cannot have order $5$.
But of course those two theorems are probably material you have not yet reached in your study.
It is also not the case that the answer boils down to the group having order a power of two, because there are finite groups of order a power of $2$ that are not abelian. For example, the multiplicative group of simple quaternions,
$$ Q_8 = \{1, -1, i, -i, j, -j, k, -k\}$$
is a group of order $2^3=8$ under multiplication (with rules $i^2=j^2=k^2=ijk=-1$) is not abelian. Of course, it is also not the case that every element is of order $1$ or $2$, but the point is that you really need “every element is of order $1$ or $2$”, and you can’t just get away with “the order of the group is a power of $2$”.
There are many ways of proving that this condition suffices. Here is a slightly different one, using the weaker property that $(ab)^2 = a^2b^2$ for all $a,b\in G$ (if every element is of order $1$ or $2$ then this holds, but this may hold even if not every element is of order $1$ or $2$): given any $x,y\in G$, we have
$$xyxy = (xy)^2 = x^2y^2 = xxyy.$$
Then multiplying by $x^{-1}$ on the left and $y^{-1}$ on the right, we obtain $yx=xy$. Thus, $G$ is abelian. 
A: Just use the property $a^2=e$ for all $a\in G$. Let $a,b\in G$ then
$$
ab=a(ab)(ab)b=(aa)ba(bb)=ba.
$$
A: I must admit I found our OP jiten's proof a little difficult to parse.
As an alternative, one might say:
$\forall x, y \in G, \; x^2 = y^2 = (xy)^2 = e, \tag 1$
from which
$x^2 = e \Longrightarrow x = x^{-1}x^2 = x^{-1}e = x^{-1}, \tag 2$
and similarly
$y = y^{-1}; \tag 3$
thus, since
$(xy)^2 = e, \tag 4$
we have
$yx = (yx)^{-1} = x^{-1}y^{-1} = xy, \; \forall x, y \in G, \tag 5$
and $G$ is abelian.
Now suppose the order of $G$ is not a power of $2$; then there is an odd prime $p$ such that
$p \mid \vert G \vert; \tag 6$
but then by Cauchy's theorem, $G$ contains an element of order $p$; however this contradicts (1), i.e., the hypothesis that every element of $G$ is of order $2$.  Thus
$\vert G \vert = 2^n, \; n \in \Bbb N. \tag 7$
$OE\Delta$.
A: Here's one way to do it: (I have left out a lot of details, though.)
Suppose $(G, +)$ is a finite group such that for every $g \in G$, $g^2 = e$. We can make $G$ into a vector space over $\mathbb{Z}_2$ by defining addition to be the group operation and multiplication to be $0 \cdot g = e$ and $1\cdot g = g$ for any $g \in G$. Indeed, one can check that this properly defines a vector space structure on $G$. It immediately follows that $|G| = 2^n$, where $n$ is the dimension of $G$.
