An affine scheme is integral if and only if it is connected and all stalks are integral domains.

Let X=Spec A. So far I have shown the easy side, i.e, if the affine scheme is integral, then it's irreducible and so connected. Since all stalks are localization of A at prime ideals, we have that all stalks are integral domains since A is an integral domain. I am having trouble proving the other way. I'm trying to prove that A is an integral domain by looking at A as the ring of global sections of X. So let f,g be two global sections of X such that fg=0. Then f_x.g_x=0(product of stalks) for all x. Then the points where the stalks of f are zero form an open set. I'm not able to show that it's also closed to get a disconnection.

• Stacks project seems to say your question is not true but I haven’t read their example stacks.math.columbia.edu/tag/0568 Jul 21, 2018 at 5:17
• Maybe you mean irreducible (as opposed to connected) and stalks are domains? Jul 21, 2018 at 5:22
• @usr0192 Yes, according to the stacks project, the above is not true. It's true if connected is replaced by irreducible. Thank you! Jul 21, 2018 at 10:25
• Another fix is to add Noetherian (and non-empty) to the hypotheses. Jul 21, 2018 at 19:33
• @SamirCanning You are right, in that case X need not necessarily be affine. Jul 22, 2018 at 0:23