This question is intimately tied to the idea of dimension. Given a commutative ring $R$, its (Krull) dimension is defined as the supremum of the lengths of chains of all prime ideals.
The name dimension for this quantity makes sense because the coordinate ring of an $n$-dimensional affine variety has Krull dimension $n$. Localization has a geometric interpretation, too: a prime ideal $\mathfrak{p}$ corresponds to an irreducible variety $V$. The localization $R_\mathfrak{p}$ consists of all rational functions that are defined at all points of $V$.
If $R$ is a local ring and its unique maximal ideal $\mathfrak{m}$ is the only prime ideal, then $R$ has dimension $0$, which, if $R$ is Noetherian, is equivalent to being Artinian.
The geometric interpretation above indicates how to produce a local ring with any number of prime ideals. Given a positive integer $n$, consider $n$-dimensional affine space $\mathbb{A}^n$ over a field $k$ of characteristic zero. Its coordinate ring is $k[x_1, \ldots, x_n]$, and if we localize at the prime (maximal, actually) ideal $(x_1, \ldots, x_n)$, we obtain the local ring $k[x_1, \ldots, x_n]_{(x_1, \ldots, x_n)}$ which consists of all rational functions on $\mathbb{A}^n$ that are defined at the origin. By the correspondence theorem for prime ideals in a localization, this ring has a chain of prime ideals
$$
(0) \subsetneq (x_1) \subsetneq (x_1, x_2) \subsetneq \ldots \subsetneq (x_1, x_2, \ldots, x_n)
$$
of length $n$.
As for an example where $R$ is not a domain: an affine variety is irreducible iff its coordinate ring is a domain, so we need to consider reducible varieties. Let $A = \frac{k[x,y]}{(xy)}$ which is the coordinate ring of the union of the lines $x = 0$ and $y = 0$ in the plane. Let $\mathfrak{m} = (x,y)$ and let
$$
R = A_\mathfrak{m} = \left(\frac{k[x,y]}{(xy)}\right)_{(x,y)}
$$
which is the local ring at the origin. Then $(x), (y)$, and $(x,y)$ are all prime ideals of $R$.
To prove the result I will use two facts which can be easily find in internet (if not, just tell me):
- Let $R$ be a integral domain. Then, $R$ is a UFD iff every non zero prime ideal contains a prime element (Kaplansky criterion).
- In an integral domain every prime ideal is principal iff it is a PID.
Now we are going to prove:
If $R$ is a UFD of Krull dimension one, then it is a PID.
Let $ \mathfrak{p} $ be a non-trivial prime ideal of $ R $ (the ideal $ \langle 0\rangle $ is principal and prime since we are working over integral domains). Since $ R $ is a UFD, we know that there exists some prime element $ p\in\mathfrak{p} $ (Kaplansky). But then $ \langle p\rangle\subseteq\mathfrak{p} $ which implies that $ \mathfrak{p}=\langle p\rangle$, as we assumed every prime ideal to be maximal. Since every non trivial prime ideal is now principal, we conclude that $ R $ is a PID.
Actually you can prove that the converse is also true, using the fact that every PID is a UFD. Then take a prime ideal which we know to be principal and suppose that it is not maximal, which leads you directly to a contradiction
Best Answer
First show that $S=T^{-1}R$ where $T$ is a multiplicative subset of $R$. This is true whenever $R$ is a PID. Now use the fact that R is local PID to show that $T^{-1}R = R $ or $K$