commutative rings whose localization at every prime ideal is a field
Solution 1:
Your question has already been answered, but let me give a proof of the characterization of commutative rings whose localizations at prime ideals are fields, that is somehow different of the proof given by rschwieb.
Theorem 1.- Let $R$ be a commutative ring. TFAE:
i) $R$ is von Neumann regular.
ii) Every prime ideal of $R$ is maximal* and $R$ is reduced.
iii) $R_P$ is a field for every prime ideal $P$ of $R$.
Proof: i)$\implies$ii) Let $P$ be a prime ideal of $R$ such that is not maximal, then there is a maximal ideal $M$ such that $P\subset M$. Pick $a\in M\setminus P$. As $R$ is von Neumann regular, there is $r\in R$ such that $a=ara=a^2r$, then $a(1-ar)=0$. Since $0\in P$ it follows that $a(1-ar)\in P$, so because $P$ is prime we have $a\in P$ or $1-ar\in P$, but by assumption $a\notin P$, therefore $1-ar\in P$, then $1-ar\in M$. Hence, $(1-ar)+ar=1\in M$, contradiction. We conclude that every prime ideal of $R$ is maximal.
On the other hand, if $a^n=0$ for some $n\in \Bbb Z^+$, then as there is $r\in R$ such that $a=a^2r$, we have $a=a^2r=(a^2r)ar=a^3r^2$ and repeated multiplication by $ar$ leads to $a=a^nr^{n-1}$. Since $a^n=0$, then $a^nr^{n-1}=0$, so $a=0$ and hence $R$ is reduced.
ii)$\implies$iii) As $R$ is reduced, then $R_P$ is reduced. Moreover, since every prime ideal of $R$ is maximal, it follows by the correspondence between the prime ideals of $R$ and of $R_P$ that $PR_P$ is the only prime (and also maximal) ideal of $R_P$. By a classical result in commutative algebra it follows that $\text{Nil}(R_P)=PR_P$, but $R_P$ reduced means that $\text{Nil}(R_P)=\{0\}$, so $PR_P=\{0\}$ which means that $\{0\}$ is a maximal ideal of $R_P$ and this in turn implies that $R_P$ is a field.
iii)$\implies$i) We are going to prove that for $a\in R$, $(a)_P=(a^2)_P$ for every prime ideal $P$ of $R$. As $R_P$ is a field, it follows that $(a)_P=\{0\}$ or $(a)_P=R_P$. In the former case we have that $a\in P$, so $a^2\in P$ and thus $(a^2)_P=\{0\}$. In the later case we have that $a\notin P$, so $a^2\notin P$ and then $(a^2)_P=R_P$. Therefore, in any case we have $(a)_P=(a^2)_P$. Since the above is true for every prime ideal $P$ of $R$, by the principle of localization we deduce that $(a)=(a^2)$ and so $a=a^2r$ for some $r\in R$. Hence, $R$ is von Neumann regular.
(*) This is the same as to say that $R$ has Krull dimension zero.
Remark 1: The above characterization of commutative von Neumann regular rings was used in the paper "Armendariz Rings and Gaussian Rings" to prove a beautiful theorem that characterizes when $R[X]$ is a Gaussian ring. More exactly, we have
Theorem 2.- Let $R$ be a commutative ring. Then $R$ is von Neumann regular if only if $R[X]$ is Gaussian.
Proof: See theorem 16 in the paper mentioned above.
Remark 2: There is an interesting generalization of the above theorem given in T. Y. Lam's book "Exercises in Classical Ring Theory", namely we have
Theorem 3.- Let $R$ be a commutative ring. TFAE:
i) $R$ has Krull dimension zero.
ii) $\text{rad}(R)$ is a nil ideal and $R/\text{rad}(R)$ is von Neumann regular. (Here $\text{rad}(R)$ is the Jacobson radical of $R$).
iii) For any $a\in R$, the descending chain $(a)\supseteq (a^2)\supseteq \ldots$ stabilizes.
iv) For any $a\in R$, there is $n\in \Bbb Z^+$ such that $a^n$ is a regular element (i.e., there exists $r\in R$ such that $a^n=a^nra^n$).
Proof: This is exercise 4.15 in Lam's book mentioned above.
Solution 2:
Yes, there is a characterization. For a commutative ring, localization at all primes are fields iff the ring is von Neumann regular.
This is pretty well-known... you can even see it in the wiki.
One way to get at it is to realize that all primes must be maximal ideals (if you localized at a maximal prime properly containing another prime, you would not get a field.) Then by this result which I have alluded to before that in such a ring, $R/J(R)$ is von Neumann regular and $J(R)$ is a nil ideal.
But $R$ being reduced is a local property, so if all its localizations at prime ideals are reduced, so is $R$. Then $J(R)=\{0\}$, and you have simply a von Neumann regular ring.
The opposite implication is trivial, considering that localizations of VNR rings are VNR, and local VNR rings are fields.