Ring of order $p^2$ is commutative. I would like to show that ring of order $p^2$ is commutative. 
Taking $G=(R, +)$ as group, we have two possible isomorphism classes $\mathbb Z /p^2\mathbb Z$ and $\mathbb Z/ p\mathbb Z \times \mathbb Z /p\mathbb Z$. 
Since characterstic must divide the size of the group then we have two possibilities $p$ and $p^2$. 
Now IU don't understand how can I reason to say that the multiplication is commutative and how can I conclude for the case when characterstic is $p$? 
 A: Let $R$ be a ring with $p^2$ elements, let $x \in R$, we have to show that $Z(x) = \{r \in R : xr=rx\}$ coincides with $R$. It is an additive subgroup, even a subring, and therefore has order $p$ or $p^2$. In the latter case we are done. Assume that it has order $p$. Every ring of order $p$ is canonically isomorphic to $\mathbb{Z}/p$. It follows that $x=z \cdot 1$ for some $z \in \mathbb{Z}$. But then obviously $Z(x)=R$.

For rings without unit, also called rngs, this fails: There are $11$ rngs with $p^2$ elements. Two of them are non-commutative, namely $E=\langle a,b : pa=pb=0, a^2=a, b^2=b, ab=a, ba=b \rangle$ and $F = \langle a,b : pa=pb=0, a^2=a, b^2=b, ab=b, ba=a\rangle.$
A: Warning: I  assume here  that "ring" means "unital ring", not "rng" without unity. 
There is a canonical ring morphism $f:\mathbb Z\to R$ (this is true for all rings).
Its image $f(\mathbb Z)\subset R$ has  cardinality either $p^2$ or $p$.
$\bullet $ In the first case $f(\mathbb Z)=R$ and since $f(\mathbb Z)= \mathbb Z/p^2\mathbb Z$ (the only quotient of $\mathbb Z$ of cardinality $p^2$) we are done: $R= \mathbb Z/p^2\mathbb Z$, a commutative ring.  
$\bullet \bullet$ In the second  case  $f(\mathbb Z)= \mathbb Z/p\mathbb Z$ (the only quotient of $\mathbb Z$ of cardinality $p$) and $R$ is a $\mathbb Z/p\mathbb Z$-algebra.
   That algebra is then generated by any element $r\in R\setminus (\mathbb Z/p\mathbb Z)$, i.e. $R=\mathbb Z/p\mathbb Z[r]$, which immediately implies that $R$ is commutative, since $f(\mathbb Z)=\mathbb Z/p\mathbb Z$ is in the center of $R$ and since powers of $r$ commute with each other.  
Complement
Actually, we can classify all the rings in $\bullet \bullet$.
If $m(x)=x^2+ax+b\in \mathbb Z/p\mathbb Z[x]$ is the minimal polynomial of $r$ over $\mathbb Z/p\mathbb Z$ we then have $R=\frac{ \mathbb Z/p\mathbb Z[x]}{\langle m(x)\rangle}$ and it follows that $$R=\mathbb F_{p^2} \;\text {(the field with} p^2 \text {elements)},\;\mathbb Z/p\mathbb Z\times \mathbb Z/p\mathbb Z \;\text{or} \;(\mathbb Z/p\mathbb Z)[x]/(x^2)$$ according as $m(x)$ is irreducible, reducible with distinct roots or reducible with a double root.  
A: Recall that a ring which is generates by one element as a ring is commutative. Indeed, it is an epimorphic image of $\mathbb Z[X]$.
Let now $R$ be of order $p^2$. Then $R$ is generated as a ring by one element:


*

*If the additive group is cyclic, then any additive generator will generate $R$ as a ring.

*If the additive group is not cyclic, it is generated by any two $\mathbb F_p$-linearly independent elemements. Since $1\in R$ is not zero, we can pick a $x\in R$ such that $\{1,x\}$ generates the additive group. In particular, $x$ generates $R$ as a ring.
A: Let $R$ be a ring with unity and $|R|= p^2,$ where $p$ is prime. Let $I$ be a principal ideal of $R$ generated by some $x.$ If $|I|=p^2$ then $I=R$ so if $(R,+) \cong \mathbb{Z}/p \oplus \mathbb{Z}/p$ then we get a contradiction since $\mathbb{Z}/p \oplus \mathbb{Z}/p$ does not contain such an $I.$ So $R\cong \mathbb{Z}/p^2$ so there exists $x\in R$ such that every element of is of the form $k.x$ for some $1\leq k\leq p^2$ and hence the product of any $2$ elements will commute as a result of being finite sums of $x.$
Hence every principal ideal must have order $p.$ Let $x,y\in R$ be arbitrary, $x \neq 1, 0$ and let $I_1, I_2$ be the principal ideal generated by $x$ and $y$ respectively. Then both $(I_1, +)$ and $(I_2, +)$ are cyclic of order $p$ and hence can be written as $I_1 = \{0,a, \ldots (p-1).a\}$ and $I_2=\{0,b, \ldots (p-1).b\}.$ By definition of an ideal, $ab, ba \in I_1\cap I_2 = \{0\}$ it follows that $ab =ba=0.$
Since $I_1+I_2$ is an ideal of size $|I_1|. |I_2|/|I_1\cap I_2| = p^2$ we have $R= I_1+I_2.$ Then for any $c, d \in R$ we have $c = m_1.a +n_1.b$ and $d=m_2.a +n_2.b$ so that $cd = (m_1m_2).a + (n_1n_2).b =dc$ and hence $R$ is commutative.
