Cardinal of a group $G$ such that for all $x\in G$ we have $x^2=e$ Let $G$ be a group such that for all $x\in G$ we have $x^2=e$. Show that if $G$ is finite then the order of $G$ is $2^n$.
Here is the solution I have seen in a book. 

If G is finite, it can be considered as a vector space over the field $\Bbb{Z}/2\Bbb{Z}$, and then necessarily is finite dimensional, which gives $G$ as a vector space isomorphic to $(\Bbb{Z}/2\Bbb{Z})^n$.

I don't understand why $G$ can be considered as a vector space over the field $\Bbb{Z}/2\Bbb{Z}$. Can, someone, explain this? Please.
 A: Alternative proof:
We have $x=x^{-1}$ so
$$\forall x,y\in G,\quad xy=(xy)^{-1}=yx$$
so $G$ is abelian. If $G=\{e\}$ then $|G|=2^0$. If $G\ne \{e\}$ so let $G\ni g_1\ne e$ and  $H_1=\{e,g_1\}$ is a subgroup of $G$. If $G=H_1$ then $|G|=2^1$ and if not let $g_2\not\in H_1$ and then 
$$H_2=H_1\cup g_2H_1$$
is a subgroup of $G$ and has the order $2^2$. With this construction we see that by a finite induction the order of $G$ is $2^n$.
A: In order to show that $G$ is a vector space, first you must show that it is abelian. Assuming you have established this, then we can write the group operation additively, and if $g,h \in G$ then $g+h$ is the sum of the two "vectors" $g$ and $h$. The condition $g^2 = e$, translated into additive notation, becomes $g + g = 0$.
Now consider the field $F = \mathbb{Z}/2\mathbb{Z}$. This field contains two elements, $0$ and $1$, with the property that $1+1 = 0$.
We define multiplication of a scalar $a\in F$ by a "vector" $g \in G$ in the obvious way: $ag = 0$ if $a = 0$, and $ag = g$ if $a = 1$.
Now we just need to verify the vector space axioms. The first four, namely associativity and commutativity of addition, existence of an additive identity, and existence of additive inverses, are consequences of the fact that $G$ is an abelian group.
The remaining four are simple to check:


*

*If $a,b \in F$ and $g \in G$, then $a(bg)$ and $(ab)g$ are both zero if either $a=0$ or $b=0$, and they are both $g$ if $a=b=1$.

*If $1$ is the multiplicative identity in $F$ and $g \in G$, then $1g = g$ by the way we defined multiplication of a scalar by a vector.

*If $a \in F$ and $g,h \in G$, then $a(g+h)$ and $ag + ah$ are both zero if $a = 0$, and they are both $g+h$ if $a = 1$.

*If $a,b \in F$ and $g \in G$, then $(a+b)g = 0$ if $a=b$ and $(a+b)g = g$ if $a \neq b$. This is because of the definition of addition in $F$. Likewise, $ag + bg = 0$ if $a=b$ (because of the condition $g+g = 0$), and $ag + bg = g$ if $a \neq b$ (because exactly one of $a$ and $b$ is zero and the other is one).


So the only remaining question is, what is the cardinality of $G$? Well, $G$ is finite dimensional, so it has some basis $\{g_1, g_2, \ldots, g_n\}$. Since $F$ has two elements, the set of all possible linear combinations $a_1 g_1 + \ldots + a_n g_n$ (where each $a_i \in F$) has cardinality $2^n$.

For completeness, here is a proof that the condition $x^2 = e$ for all $x \in G$ forces $G$ to be abelian. If $x,y \in G$, then $xyxy = (xy)(xy) = e$. Therefore, multiplying on the left by $x^{-1}$ and on the right by $y^{-1}$, we get $yx = x^{-1}y^{-1}$. Therefore, $xyx^{-1}y^{-1} = xyyx = x(yy)x = xex = xx = e$. Multiplying $xyx^{-1}y^{-1} = e$ on the right by $y$ and then by $x$ gives us $xy = yx$.
A: Bungo has given a very detailed proof that such a $G$ is a vector over $\mathbb{Z}/2\mathbb{Z}$. However, I'll give a slightly more abstract argument that makes the verification a little quicker. 
For any ring $R$ (We'll consider commutative rings with unity), we can define the notion of an $R$-module $M$, which is basically a vector space except the scalars come from a ring. All the axioms are the same. However $R$-modules are not necessarily as nicely behaved if $R$ is not a field. One very important idea is that a $\mathbb{Z}$-module is simply an abelian group. the multiplication is simply
$$(n,x) \mapsto x^n$$
for $n \in \mathbb{N}, x \in G$. This is the reason people tend to like writing Abelian groups with the binary operation as "vector addition". Hopefully you already see how much more complicated general $R$-modules are.
One way in which a module $M$ over $R$ can be "bad" is that we can define $$\text{Ann }M =  \{r \in R | rm = 0, \forall m \in M\}$$
This is an ideal of $R$, and for any ideal $I \subset \text{Ann } M$, the module $M$ has a natural structure as an $R/I$-module, by the rule $(r +I)m := rm$.
Finally an Abelian group $G$ such that $x^2 = e$ for all $x$ (additively written as $2x =0$) is a $\mathbb{Z}$-module with $\text{Ann }G = 2\mathbb{Z}$. So $G$ is a $\mathbb{Z}/2\mathbb{Z}$-module, which since this is a field, is a vector space.
But honestly all this is a bit much. I would say the better argument for the exercise is to apply Cauchy's theorem, which said that for a prime $p$ dividing $|G|$, $G$ contains an element of order $p$. Since all nontrivial elements of $G$ have order $2$, $2$ is the only prime diving $|G|$.
