Show that the resulting set is a group with $p^3$ elements. Consider the set of all formal products of the symbols $a, b, c, a^{-1}, b^{-1}, c^{-1},$ and $e,$ where we identify $a^2$ with $aa,\,ae$ and $ea$ with $a,a^{-1}a$ and $aa^{-1}$ with $e,$ etc. For an odd positive prime $p,$ assume that $a^p = b^p = c^p = e,\,\, ac = ca, \,\, bc = cb, c = aba^{-1}b^{-1}.$
Prove that the resulting set is a group with $p^3$ elements.
Source: Problem #11.

In the group, let $G,$ the order of all three elements $a,b,c=p,$ an odd príme. The group is not abelian as $ab\ne ba.$
Can use $c = aba^{-1}b^{-1}$ to derive something, if $ba^{-1}\ne a^{-1}b.$ Else, derive $c=e.$ 
But, get stuck.
Even, by taking a value of $p=3,$ don't get how derive from:
$a^{3^3}= b^{3^3}= c^{3^3}= e,$ the fact that $c= aba^{-1}b^{-1}.$
 A: The Heisenberg group mod $p$ is the group $H$ of matrices of the form
$$M_{x,y,z}:=\begin{pmatrix}
 1 & x & z\\
 0 & 1 & y\\
 0 & 0 & 1\\
\end{pmatrix},\quad x,y,z\in\mathbb Z/p\mathbb Z.$$
It is of order $p^3$ and is the image of $G$ under the epimorphism
$$\varphi:G\to H,\quad a\mapsto M_{\bar 1,\bar 0,\bar 0},\quad b\mapsto M_{\bar 0,\bar 1,\bar 0},\quad c\mapsto M_{\bar 0,\bar 0,\bar 1}.$$
There remains to prove that this epimorphism is injective.
The subset
$$K:=\{a^ib^jc^k\mid i,j,k\in\mathbb Z\}\subset G$$
is closed under right multiplication by $c^{\pm1}$ (obviously), by  $b^{\pm1}$ (since $b$ commutes with $c$), but also by $a^{\pm1}$, since $a$ commutes with $c,$ $ba=abc^{-1},$ and $ba^{-1}=a^{-1}bc.$ This proves that $G=K,$ thus allowing to conclude that distinct elements of $G$ are sent by $\varphi$ to distinct elements of $H$, since
$$\varphi(a^ib^jc^k)=M_{\bar i,\bar j,\overline{k+ij}}.$$
Credit: this is very similar to the study of the Heisenberg group over $\mathbb Z$ by D. L. Johnson, Presentations of Groups, p. 60-61
A: Hint. Every element of this set can be expressed in the form
$$
g=a^ib^jc^k, \quad i,j,k=0,\ldots,p-1.
$$
Since all the elements are spanned by $a,b,c$, it suffices to show that
$$
(a^ib^jc^k)(a^rb^sc^t)=a^mb^nc^p,
$$
for suitable $m,n,p$. Observe that
$$
(a^ib^jc^k)(a^rb^sc^t)=a^ib^ja^rb^sc^{k+t},
$$
and since $ba=abc^{-1}$, then if $j,r\ne 0$,
$$
a^ib^ja^rb^sc^{k+t}=a^ib^{j-1}baa^{r-1}b^sc^{k+t}=
a^ib^{j-1}abc^{-1}a^{r-1}b^sc^{k+t}=a^ib^{j-1}aba^{r-1}b^sc^{k+t-1}=\cdots=
a^ib^{j-1}aa^{r-1}bb^sc^{k+t-r}=\cdots=a^{i+r}b^{j+s}c^{k+t-rs}.
$$
