Mistake in proving that every group of order $p^n$ is abelian? Let $G$ be a group of order $p^n$. Consider the action $ {\bf Z}/p{\bf Z}\times G \to G$ defined as $$(a,g) \to g^a$$ Hence $G$ is a $ {\bf Z}/p{\bf Z}$-vector space of dimension $n$, hence $G \cong ({\bf Z}/p{\bf Z})^n$.

In particular, the above argument shows that  every group of order $p^n$ is abelian,which is of course not true for $n>2$

Could someone please tell me my mistake in above argument?
 A: The condition @Crostul has given in his first comment is not for this to be an action, but for $\mathbf{Z}/p\mathbf{Z}$ to act as automorphisms. 
Suppose this is an action of the additive group $\mathbf{Z}/p\mathbf{Z}$ on $G$, Then first of all we need  $G$ to be of exponent $p$ (which ensures that the action is well defined), that is, since notation is multiplicative, $G^{p} = 1$. But then the very first condition for this to be an action would imply for all $g \in G$
$$
1 = g^{0} = g,
$$
that this, it is an action for $\mathbf{Z}/p\mathbf{Z}$ iff $G = \{ 1 \}$. (Alternatively, the other axiom for actions $g^{ab} = (g^{a})^{b} = g^{a + b}$ is satisfied for $a = b = 1$ only by $g = 1$, that is, once more, only iff $G = \{ 1 \}$. Here I have used the rule of powers $g^{ab} = (g^{a})^{b}$, which holds in any (possibly non-abelian) group.)
However, if $G$ is of exponent $p$, one has an action of the multiplicative group $(\mathbf{Z}/p\mathbf{Z})^{*}$ on $G$, as $g^{1} = g$ and $g^{ab} = (g^{a})^{b}$. That is, this is an action of $(\mathbf{Z}/p\mathbf{Z})^{*}$ on $G$.
But as correctly remarked, for $G$ to be a vector space, one needs it to be abelian. And there are groups of exponent $p > 2$ which are non-abelian, check for instance the group $G$ of matrices of order $p^{3}$:
$$
G
=
\left\{\,
\begin{bmatrix}
1 & a & b\\
0 & 1 & c\\
0 & 0 & 1
\end{bmatrix}
:
a, b, c \in \mathbf{Z} / p \mathbf{Z}
\,
\right\}
$$
