Showing a ring with 1 is isomorphic to the ring of residue classes modulo p I have a ring $R$, which is a ring with 1 such that the number of elements in $R$ is $p$, a prime. I seek to show that $R$ is isomorphic to $\mathbb{Z_p}$. 
I have a book which shows a 4 step approach, where the first step is to define a function which would give the isomorphism, but I'm unsure how to define this function. I would like some help on defining a function, and then I will try the remaining steps myself.
 A: Since $(R,+,\cdot)$ has $p$ elements, it follows that the group $(R,+)$ has $p$ elements. Since the order of $1$ in $(R,+)$ cannot be $1$ (because $1 \ne 0$ in $R$), and the order of every element divides the order of the group, it follows that the order of $1 \in R$ is $p$, i.e. that $1$ is a generator of the group $(R,+)$. This means that for every $x \in R$ there exist a unique $n \in \{0, \dots, p-1\}$ such that $x = \underbrace {1 + \dots + 1} _{n \text{ times}}$ (the logarithm of $x$ with respect to $1 \in R$).
Define $f : R \to \Bbb Z /(p)$ by $f(\underbrace {1 + \dots + 1} _{n \text{ times}}) = \hat n$. $f$ is well-defined because the logarithm with respect to $1 \in R$ of every element is unique. It is easy to show that $f$ is a group homomorphism between $(R,+)$ and $(\Bbb Z /(p), +)$. Let us show that $f(xy) = f(x)f(y)$. Notice that if $x = \underbrace {1 + \dots + 1} _{m \text{ times}}$ and $y = \underbrace {1 + \dots + 1} _{n \text{ times}}$ then $xy = (\underbrace {1 + \dots + 1} _{m \text{ times}}) (\underbrace {1 + \dots + 1} _{n \text{ times}}) = (\underbrace {1 + \dots + 1} _{mn \text{ times}})$. This implies that
$$f(xy) = f(\underbrace {1 + \dots + 1} _{mn \text{ times}}) = \underbrace {f(1) + \dots + f(1)} _{mn \text{ times}} = (\underbrace {f(1) + \dots + f(1)} _{m \text{ times}}) (\underbrace {f(1) + \dots + f(1)} _{n \text{ times}}) = \\
f(\underbrace {1 + \dots + 1} _{m \text{ times}}) f(\underbrace {1 + \dots + 1} _{n \text{ times}}) = f(x)f(y) ,$$
which implies that $f$ is a ring homomorphism.
If $f(\underbrace {1 + \dots + 1} _{m \text{ times}}) = f(\underbrace {1 + \dots + 1} _{n \text{ times}})$ then $\hat m = \hat n$, i.e. $p \mid m-n$ and, since $m,n \in \{0, \dots, p-1\}$, it follows that $m=n$, therefore $f$ is injective.
If $\hat n \in \Bbb Z /(p)$, then letting $m = n \pmod p$ we have $f(\underbrace {1 + \dots + 1} _{m \text{ times}}) = \hat n$, which shows that $f$ is surjective.
We have proved, therefore, that $f$ is a ring isomorphism.
