Classifying Unital Commutative Rings of Order $p^2$ I'm trying to classify unital commutative rings of order $p^2$, where $p$ is a prime. At first, I happened to neglect the 'unital' and 'commutative' requirements, and after an arduous route I managed to show that there are $11$ such rings up to isomorphism. Some are non-commutative and non-unital, and the journey to that result is a bit ugly for a class on commutative algebra.
This should be easier if we only consider unital rings of order $p^2$. (It's easy to show that if it's unital, then it's commutative in this case). But so far, I haven't found a solution that doesn't use the fact that I found representations for the $11$ rings.
I am certain that a much less technical and messy method to find unital commutative rings of order $p^2$ is possible. For reference on the context, this question comes amidst a review of the Chinese Remainder Theorem, the Structure Theorem on Modules over a PID, tensor products, and algebras. I heavily suspect that if I were more fluent in applying the CRT, I would be able to get there.
Do you have any ideas?
By the way, I believe there are $4$. They should look like $\mathbb{F}_{p^2}, \mathbb{Z}_{p^2}, \mathbb{Z}_p [x]/(x^2),$ and (I don't know a convenient name for the fourth, but e.g., the Klein 4-group with standard ring structure on top, which I'm inclined to designate $\mathbb{Z}_{p \times p}$). In a more convenient designation, 1 is built on the additive group $C_{p^2}$ and 3 are built on $C_p \times C_p$. I would be content if I could enumerate how many rings are on each additive group, up to homomorphism, instead of actually classifying them.
 A: In a unital ring $R$ of order $p^2$ the additive order of $1$ can only be $p$ or $p^2$. In the second case, $1$ generates the additive group, so it is clear that the ring itself is isomorphic to $\mathbb Z/(p^2)$. So we concentrate in the first option.
In that case all non-zero elements have additive order $p$, so the ring is in fact a $2$-dimensional $\mathbb F_p$-algebra. Pick any element $x\in R$ which is linearly independent with $1$, so that $\{1,x\}$ is a basis. We must have $x^2=a+bx$ for some $a$, $b\in\mathbb F_p$, and then $R$ is isomorphic to $\mathbb F_p[X]/(X^2-aX-b)$.
If $X^2-aX-b$ is irreducible over $\mathbb F_p$, then $R$ is a field, and there is only one field of order $p^2$: $\mathbb F_{p^2}$. If not, then it factors as $(X-\alpha)(X-\beta)$ over $\mathbb F_p$. It is easy to see now that if $\alpha\neq\beta$ we have $R\cong\mathbb F_p\times\mathbb F_p$ and if $\alpha=\beta$ then $R\cong\mathbb F_p[X]/(X^2)$.
Interestingly, the fact that $R$ is commutative plays no role here, and there are no non-commutative rings of order $p^2$.
For fun, let us suppose now that $R$ does not have a unit, and let us see what happens.
First, suppose the addititive group is cyclic, so that there is an additive generator $x\in R$ of order $p^2$. Then there is an $n\in\{0,\dots,p^2-1\}$ such that $x^2=nx$. It is clear that the isoclass of $R$ is determined by $n$. 
But there is an ambiguity, as there are other generators: any other generator of the additive group is of the form $ax$ with $a$ a unit of $\mathbb Z/(p^2)$.
If instead of $x$ we had started with $y=ax$, then as $y^2=a^2x^2=a^2nx=any$, instead of $n$ we would have found $an$. It follows that the isomorphism classes of rings of this form are parametrized by the quotient of $\mathbb Z/(p^2)$ under the action of its group of units given by left multiplication.
If I did not get this too wrong, there are three orbits: the one for $0$, the one for $1$ and the one for $p$, so there are three rings of this type.
Second, let us suppose that the additive group is not cyclic, so that all non-zero elements have order $p$, and $R$ is in fact a $\mathbb F_p$-vector space. 
Suppose there is a non-zero idempotent $e\in R$. Let $\lambda:a\in R\mapsto ea\in R$ and $\rho:a\in R\mapsto ae\in R$. These are two idempotent $\mathbb F_p$-linear maps which commute. Linear algebra tells us then that there is a direct sum decomposition $$R=R_{00}\oplus R_{10}\oplus R_{01}\oplus R_{11}$$
with
\begin{align}
&R_{00}=\{x\in R:ex=xe=0\},\\
&R_{10}=\{x\in R:ex=x, xe=0\},\\ 
&R_{01}=\{x\in R:ex=0, xe=x\}, \\
&R_{11}=\{x\in R:ex=xe=x\}.
\end{align}
At most two of these subspaces can be non-zero, and we know that $R_{11}$ contains $e$. Also, $R_{11}$ cannot be all of $R$ because we are supposing there is no unit.


*

*If there is a non-zero element in $R_{10}$, call it $x$. Then $\{e,x\}$ is a basis, $ex=x$, $xe=0$ and $xx=x(ex)=(xe)x=0x=0$. The multiplication is therefore completely determined.

*Similarly, if there is a non-zero element $x\in R_{01}$, $\{e,x\}$ is again a basis, and we have $ex=0$, $xe=x$ and $xx=0$.

*Finally, if there is a non-zero element $x\in R_{00}$, we have $ex=xe=0$. Then $ex^2=(ex)x=0$ and similarly $x^2e=0$, so $x^2$ is too in $R_{00}$, and there is a scalar $a$ such that $x^2=ax$. If $a\neq0$, we let $y=a^{-1}x$, so that $y^2=a^{-2}x^2=a^{-1}x=y$, and since $\{e,y\}$ is a basis this determines the multiplication. If $a=0$, of course the multiplication is also fixed.
We are left with the case in which there are no non-zero idempotents in $R$. A classical theorem of Albert implies that all non-zero elements must be nilpotent. If there is an $x\in R$ which is non-zero and such that $x^2$ is linearly independent with $x$, then $\{x,x^2\}$ is a basis, and we must have $x^3=0$, for the map $a\in R\mapsto xa\in R$, being a nilpotent endomorphism of a vector space of dimension $2$, must have nilpotency index at most $2$. We see that the multiplication table is completely determined here too.
Finally, suppose all non-zero elements are nilpotent but for for each $x$ of them, we have that $x^2$ is a linear multiple of $x$. All elements of $R$ must therefore square to zero. Let $\{x,y\}$ be a basis, and suppose $xy=ax+by$ and $yx=cx+dy$. Then $0=(x+y)^2=(a+c)x+(b+d)y$, so $yx=-xy$. Now call $u=xy$. If $u$ is zero, then all products are zero. If $\{x,u\}$ is a basis, then we know its the multiplication, as $x^2=u^2=xu=ux=0$. If not, $\{y,u\}$ is a basis, and again all products are zero.
A: What a strange coincidence: I've been wasting a bunch of time recently thinking about principal Artinian rings.  Now every commutative, unital ring of order $p^2$ is principal: indeed, every nonzero proper ideal must in particular have order $p$ so is even generated as an additive subgroup by any one nonzero element.  
Step 1: The only (commutative, unital: this will be omitted from now on) ring of order $p$ is $\mathbb{Z}/p\mathbb{Z}$.  For instance, it must have a maximal ideal and a residue field, and the size constraints force the maximal ideal to be $(0)$ and the residue field to have order $p$.  
Step 2: Every finite ring is an Artinian ring, hence isomorphic to a product of Artinian local rings.  So for rings of order $p^2$, the only one which is a nontrivial product is $\mathbb{Z}/p\mathbb{Z} \times \mathbb{Z}/p \mathbb{Z}$.  The others are local Artinian principal rings.  Let $R$ be such a ring of order $p^2$.  
Step 3: It is easy to see that the characteristic of $R$ is either $p^2$ or $p$ and in the former case we must have $R \cong \mathbb{Z}/p^2 \mathbb{Z}$.  
Step 4: Suppose that $R$ has characteristic $p$.  If the unique maximal ideal if $(0)$, then $R \cong \mathbb{F}_{p^2}$ is the finite field of order $p^2$.  Otherwise the maximal ideal is generated by an element $t$ with $t^2 = 0$.  From this it is easy to see that $R \cong (\mathbb{Z}/p \mathbb{Z})[t]/(t^2)$.  
Final tally: $R$ is one of 

$\mathbb{Z}/p \mathbb{Z} \times \mathbb{Z} / p \mathbb{Z}, \ \mathbb{Z}/p^2 \mathbb{Z}, \mathbb{F}_{p^2}, \ (\mathbb{Z}/p\mathbb{Z})[t]/(t^2)$.  

