Let us consider the subset
\[Z:=\{z\in R \mid zr=rz \text{ for any } r\in R\}.\]
(This is called the center of the ring $R$.)

This is a subgroup of the additive group $R$.
In fact, if $z, z’\in Z$, then we have for any $r\in R$,
\begin{align*}
(z-z’)r=zr-z’r=rz-rz’=r(z-z’).
\end{align*}
It follows that $z-z’\in Z$, and thus $Z$ is a subgroup of $R$.

Note that $0, 1 \in Z$, hence $Z$ is not a trivial subgroup.
Thus, we have either $|Z|=p, p^2$ since $R$ is a group of order $p^2$.

If $|Z|=p^2$, then we have $Z=R$.
By definition of $Z$, this implies that $R$ is commutative.

It remains to show that $|Z|\neq p$.
Assume that $|Z|=p$.
Then $R/Z$ is a cyclic group of order $p$.
Let $\alpha$ be a generator of $R/Z$.

Since $Z\neq R$, there exist $r, s\in R$ such that $rs\neq sr$.
Write
\[r=m\alpha+z \text{ and } s=n\alpha+z’\]
for some $m, n\in \Z$, $z, z’\in Z$.

Then we have
\begin{align*}
rs&=(m\alpha+z)(n\alpha+z’)\\
&=(m\alpha)(n\alpha)+m\alpha z’ + n z\alpha +z z’\\
&=(n\alpha)(m\alpha)+m z’ \alpha +n \alpha z +z’ z\\
&=(n\alpha+z’)(m\alpha+z)\\
&=sr.
\end{align*}

This contradicts $rs\neq sr$, and we conclude that $|Z|\neq p$.

Primary Ideals, Prime Ideals, and Radical Ideals
Let $R$ be a commutative ring with unity. A proper ideal $I$ of $R$ is called primary if whenever $ab \in I$ for $a, b\in R$, then either $a\in I$ or $b^n\in I$ for some positive integer $n$.
(a) Prove that a prime ideal $P$ of $R$ is primary.
(b) If $P$ is a prime ideal and […]

Generators of the Augmentation Ideal in a Group Ring
Let $R$ be a commutative ring with $1$ and let $G$ be a finite group with identity element $e$. Let $RG$ be the group ring. Then the map $\epsilon: RG \to R$ defined by
\[\epsilon(\sum_{i=1}^na_i g_i)=\sum_{i=1}^na_i,\]
where $a_i\in R$ and $G=\{g_i\}_{i=1}^n$, is a ring […]

Torsion Submodule, Integral Domain, and Zero Divisors
Let $R$ be a ring with $1$. An element of the $R$-module $M$ is called a torsion element if $rm=0$ for some nonzero element $r\in R$.
The set of torsion elements is denoted
\[\Tor(M)=\{m \in M \mid rm=0 \text{ for some nonzero} r\in R\}.\]
(a) Prove that if $R$ is an […]

There is Exactly One Ring Homomorphism From the Ring of Integers to Any Ring
Let $\Z$ be the ring of integers and let $R$ be a ring with unity.
Determine all the ring homomorphisms from $\Z$ to $R$.
Definition.
Recall that if $A, B$ are rings with unity then a ring homomorphism $f: A \to B$ is a map […]

Three Equivalent Conditions for a Ring to be a Field
Let $R$ be a ring with $1$. Prove that the following three statements are equivalent.
The ring $R$ is a field.
The only ideals of $R$ are $(0)$ and $R$.
Let $S$ be any ring with $1$. Then any ring homomorphism $f:R \to S$ is injective.
Proof. […]

The Preimage of Prime ideals are Prime Ideals
Let $f: R\to R'$ be a ring homomorphism. Let $P$ be a prime ideal of the ring $R'$.
Prove that the preimage $f^{-1}(P)$ is a prime ideal of $R$.
Proof.
The preimage of an ideal by a ring homomorphism is an ideal.
(See the post "The inverse image of an ideal by […]

Ideal Quotient (Colon Ideal) is an Ideal
Let $R$ be a commutative ring. Let $S$ be a subset of $R$ and let $I$ be an ideal of $I$.
We define the subset
\[(I:S):=\{ a \in R \mid aS\subset I\}.\]
Prove that $(I:S)$ is an ideal of $R$. This ideal is called the ideal quotient, or colon ideal.
Proof.
Let $a, […]

Fundamental Theorem of Finitely Generated Abelian Groups and its application
In this post, we study the Fundamental Theorem of Finitely Generated Abelian Groups, and as an application we solve the following problem.
Problem.
Let $G$ be a finite abelian group of order $n$.
If $n$ is the product of distinct prime numbers, then prove that $G$ is isomorphic […]