$Z_{p^n}$ is a local ring I was trying to prove that: if $p$ is prime and $n \gt 1$, then $Z_{p^n}$ is a local ring with unique maximal ideal $(p)$. 
I was trying to show that $(p)$ consists of all nonunits. How to show that the elements outside $(p)$ are units?
 A: There is a nice characterization of the multiplicative units of $\mathbb{Z}/m\mathbb{Z}$ for any natural number $m$, which generalizes what you're trying to do.  A hint would be to think about (or look up) the Euclidean algorithm and think about its implications.
A: As an alternative to the excellent answer by Rolf Hoyer, you may first check that if $x \not\equiv0 \pmod{p}$, then $x^{p-1} \equiv 1 \pmod{p}$, and then check that for any $a$
$$
(1 + a p)^{p^{n}} \equiv 1 \pmod{p^{n}}.
$$
A: If $A$ is a ring and $I$ an ideal, then the ideals of $A/I$ are in 1-1 correspondence with ideals of $A$ containing $I$, and the order is preserved in the sense that if $I \subset J \subset K$ are ideals, then $(0) \subset J/I \subset K/I$ are ideals in the quotient ring. In particular, maximal ideals containing $I$ map to maximal ideals in $A/I$.
In this case, we know that the maximal ideals of $\mathbf{Z}$ are of the form $(p)$, and the only maximal ideal containing $(p^n)$ is $(p)$, so the only maximal ideal in $\mathbf{Z}/(p^n)$ is $(p)/(p^n)$.
A: Let $u \in Z_{p^n}-(p)$, then it is relatively prime with $p^n$ so there exist integers $m,n$ s.t. $mu+np^n=1 \implies mu=1-p^n$, and under modulo $p^n$ it gives $mu=1$.  $ \hspace{1cm} $ Q.E.D
