Let $p$ be a prime. Show that there exists only two non isomorphic rings with $p$ elements.
My definition of rings does not require that the ring must have an identity $1\neq 0.$
I feel that there are two rings of order $p.$ They are $(\Bbb Z_p,+,.)$ And $(\Bbb Z_p,+,×),$ where $.$ is multiplication modulo $p$ and $×$ is such an operation so that $a.b=0,\forall a,b\in \Bbb Z_p.$
I took an arbitrary commutative ring $R$ order $p.$ If $R$ has a unit element, then I tried to show $R\cong (\Bbb Z_p,+,.).$
I know that every cyclic group of prime order is isomorphic $\Bbb Z_p$ under $+.$ I tried defining a map $\phi:R\to \Bbb Z_p$ such that, $\phi(1)=1_p.$
By knowing where $1$ goes, I feel I can fully know what $\phi$ really is?
The choice that $1$ goes to $1_p$ under $\phi$ was just a heuristic intuition. Since, $R$ is a cyclic group of prime order under $+$ operation, so every non zero element of $R$ is a generator of $(R,+).$ This means, if $a\in R$ then, $\exists n\in\Bbb Z\setminus\Bbb Z^-$ such that $a=n(1).$ So, $\phi(a)=\phi(n(1))=n\phi(1)=n(1_p)=n_p.$ We note that $a$ is arbitrary. So, $\phi$ is completely determined.
We have, $\phi(n(1))=n_p,\forall n\in\Bbb Z.$
Now we must verify that $\phi$ is indeed a ring homomorphism.
Let $a,b\in R$ then there exists, $n_1,n_2\in \Bbb Z$ such that $a=n_1(1)$ and $b=n_2(1).$ Thus $$a+b=(n_1+n_2)(1)\implies \phi(a+b)=(n_1+n_2)_p=(n_1)_p+(n_2)_p=\phi(a)+\phi(b).$$ Again, $$ab=(n_1n_2)_p(1)\implies \phi(ab)=(n_1n_2)_p=(n_1)_p(n_2)_p\phi(a)\phi(b).$$
So, $\phi$ is a ring homomorphism.
Let $n_p\in \Bbb Z$ then, $\exists n(1)\in R$ and, $\phi(n(1))=n_p.$ This proves, that $\phi$ is onto.
If $$\phi(m(1))=\phi(n(1))\implies m_p=n_p\implies (m_p)(1)=m(1)=(n_p)(1)=n(1).$$ Thus, $\phi$ is one-to-one.
Finally, we can say that $R\cong (\Bbb Z_p,+,.).$
Is my work till now valid?
However, I don't know how to show that $R\cong (\Bbb Z_p,+,×)$ if $R$ does not have a unit element, i.e a $1\neq 0.$
This answer is almost entirely based on the answer to a duplicate question https://math.stackexchange.com/a/1090955/1264774 by Andreas Caranti. I just try to provide a clearer explanation in better details.
If $R$ is not isomorphic to $(\mathbb{Z}_p, +, \times)$ where all products are zero, then there are some $a, b \in R$ such that $ab \neq 0$. We prove this $R$ is unital, so with your correct partial proof, we can have a complete proof.
The map $\psi: R \to R; x \mapsto ax$ is a group homomorphism. The image $\psi (R)$ is a subgroup of $(R, +)$. Since $|R| = p$, we have $|\psi (R)| = 1 \text{ or } p$. By assumption, $ab \neq 0$, so $|\psi (R)| \geq 2$. Hence, $|\psi (R)| = p$, and $\psi$ is bijective. In particular, there exists an $e \in R$ such that $a e = \psi(e) = a$. For all $x \in R$, we have $\psi(e x) = a (e x) = (a e) x = a x = \psi(x)$, so $e x = x$ by the bijectivity of $\psi$. By a similar argument with $R \to R; x \mapsto xb$, we will find an $e' \in R$ such that $\forall x \in R, x e' = x$. Now, we have found a left identity $e$ and a right identity $e'$ of $R$, so $e = e e' = e'$ is the two-sided multiplicative identity $R$.
Thus, $R$ is unital. By the proof in the description, this $R$ is isomorphic to $(\mathbb{Z}_p, +, .)$, i.e. the usual ring of integers modulo $p$.