TITLE: When is a commutative ring the limit of its local rings?
QUESTION [14 upvotes]: Let $A$ be a commutative ring. Then we get local rings $A_p$ by localizing at each prime ideal $p$. Moreover, we get $A_p \rightarrow A_q$ when $p$ contains $q$. So we get a big diagram indexed by the inclusion poset of prime ideals. When is $A$ the limit of this diagram?
When $A$ is a local ring or an integral domain it's true. I don't see any reason why it should be true for arbitrary rings. What's going on here?

REPLY [6 votes]: This is a minor variation of MH's response:
A ring R is Boolean if x^2 = x for all x in R.  (This implies R is commutative.)
In a Boolean ring R, every prime ideal is maximal,  Moreover, the only local Boolean ring is Z/2Z.  Therefore, R' := inverse limit_{p \in Spec R} R_p = (Z/2Z)^{# Spec R}.  In particular, R' is either finite or uncountably infinite.
But there are certainly countably infinite Boolean rings (a fancy justification for this is the Lowenheim-Skolem theorem in model theory): take an uncountable Boolean ring, and consider the subring generated by a countably infinite set of generators. 
For more details on Boolean rings, see e.g. Section 4.5 of 
http://math.uga.edu/~pete/integral.pdf