Set of points where stalk is integral domain is open I struggled to find a solution for the exercise 4.9 in the second chapter of Liu's book Algebraic Geometry and Arithmetic Curves.
The first part is to show the set of points $x\in X$ such that $\mathcal{O}_{X,x}$ is reduced is an open subset when $X$ is a locally Noetherian scheme. This is not a problem because since $X$ is locally Noetherian we can assume to work with an affine Noetherian scheme $\text{Spec}A$, where $A$ is a Noetherian ring, and $\{\mathfrak{p}\in\text{Spec}A | A_{\mathfrak{p}} \text{is reduced}\}=\{\mathfrak{p}\in\text{Spec}A | (N_A)_{\mathfrak{p}}=0\}=\text{Spec}A-\text{supp}(N_A)=\text{Spec}A-V(Ann(N_A))$ and this is open.
The second part is the same thing with integral domains, show the set of points $x\in X$ such that $\mathcal{O}_{X,x}$ is an integral domain is an open subset when $X$ is a locally Noetherian scheme. This is where my problems start. As above we can assume to work with an affine and Noetherian scheme $\text{Spec}A$ with $A$ Noetherian ring. I think I have to find a characterization of the prime ideals where the localization is an integral domain, something like the reduced case.
After hours of attemps, my ideas are:

*

*if $\frac{a}{s}\frac{b}{t}=0\in A_{\mathfrak{p}}\Leftrightarrow $ exists $u\in A-\mathfrak{p}$ such that $abu=0$ in $A$ and so $a,b$ must be zero-divisors in $A$.

*if $a,b\ne0$ in $A$ and $ab=0$, in $A_{\mathfrak{p}}$ at least one of $a,b$ must be zero in $A_{\mathfrak{p}}$, otherwise $\frac{a}{1}\frac{b}{1}=0$, and so $\mathfrak{p}\notin \text{supp}(a)$ or $\mathfrak{p}\notin\text{supp}(b)$.

If we take $D$ the set of the zero-divisors of $A$ without zero, $$ M_{(a,b)}=\text{supp}(a)^c\cup \text{supp}(b)^c=(\text{supp}(a)\cap \text{supp}(b))^c, \quad \forall a,b\in D$$
then each $M_{(a,b)}=\text{Spec}A-V(Ann(a)+Ann(b))$ is open in $\text{Spec} A$.
This is my claim: $U=\bigcap_{a,b\in D}M_{(a,b)}$ is exactly the set of prime ideals such that the localization is an integral domain.
If $\mathfrak{p}$ is such that $A_{\mathfrak{p}}$ is an integral domain, then $\forall a,b\in D$ necessarily $\mathfrak{p}\in(\text{supp}(a)\cap \text{supp}(b))^c=M_{(a,b)}$. If $\mathfrak{p}$ is such that $A_{\mathfrak{p}}$ is not an integral domain, then there exist $\frac{a}{s},\frac{b}{t}\in A_{\mathfrak{p}}$ such that $\frac{a}{s}\frac{b}{t}=0$ and hence $a,b$ are zero-divisors of $A$ and $\mathfrak{p}\in\text{supp}(a)\cap \text{supp}(b)=M_{(a,b)}^c$ and $\mathfrak{p}\notin U$.
The problem of this construction is that the set $U$ is not open and I can't conclude.
Is this the right way to follow? Could someone give me some hints or advices?
Thanks in advance to those who can answer me.
 A: As you said, let $A$ be a Noetherian ring. Remember that a ring is an integral domain if and only if it is reduced and has only one minimal prime. On the other hand, minimal primes of $A_{\mathfrak p}$ are minimal primes of $A$ contained in $\mathfrak p$.
Since $A$ is Noetherian, there are only finitely many minimal primes $\mathfrak p_1, \ldots , \mathfrak p_n$ in $A$, so $A_{\mathfrak p}$ has at least two minimal primes if and only if there are $i \neq j$ such that $\mathfrak p_i + \mathfrak p_j \subset \mathfrak p$, or equivalently, if $\mathfrak p \in V(\mathfrak p_i + \mathfrak p_j)$. Thus,
$$
\{\mathfrak p \mid A_\mathfrak p \text{ has one minimal prime}\} = \operatorname{Spec}A \smallsetminus \bigcup_{i \neq j} V(\mathfrak p_i + \mathfrak p_j)
$$
is open, and by the first comment of my post,
$$
\{\mathfrak p \mid A_\mathfrak p \text{ is an integral domain}\} = \{\mathfrak p \mid A_\mathfrak p \text{ is reduced}\} \cap \{\mathfrak p \mid A_\mathfrak p \text{ has one minimal prime}\}
$$
is also open.
A: I’m turning my comment into an answer. Let $A$ be a Noetherian ring, and $\mathfrak{p}$ be a prime ideal such that $A_{\mathfrak{p}}$ is a domain. We want to show that the set $D$ of prime ideals $\mathfrak{q}$ of $A$ such that $A_{\mathfrak{q}}$ is an integral domain is open.
Let $I \subset A$ be the kernel of the localization $A\rightarrow A_{\mathfrak{p}}$, $I$ is generated by elements $a_1,\ldots,a_n$. For each $i$, there exists some $b_i \notin \mathfrak{p}$ such that $a_ib_i=0$. Let $f=b_1\ldots b_n \notin \mathfrak{p}$. Then the image of $I$ in $A_f$ vanishes.
Let $x=a/b \in A_f$ be such that its image in $A_{\mathfrak{p}}$ is zero. Then the image of $a$ in $A_{\mathfrak{p}}$ vanishes, so $a \in I$ and thus $x=a/b=0$.
In other words, the localization $A_f \rightarrow A_{\mathfrak{p}}$ is injective. As $A_{\mathfrak{p}}$ is an integral domain, so is $A_f$.
Now, if $\mathfrak{q}$ is another prime ideal of $A$ not containing $f$, then $A_{\mathfrak{q}}$ is a localization of the integral domain $A_f$ so is an integral domain. In other words, $\mathfrak{p}\in D(f) \subset D$. QED.
A: I think this can be done with primary decomposition :)
Suppose $X=\text{Spec}(A)$ is an affine Noetherian scheme and set $Z=\{\mathfrak{p}\in \text{Spec}(A)\mid A_\mathfrak{p}\text{ is not an integral domain}\}.$ In general, all ideals $\mathfrak{a}$ in Noetherian rings admit some primary decomposition - $\mathfrak{a}$ can be expressed as an intersection of finitely many primary ideals $\mathfrak{a}=\mathfrak{q}_1\cap\dots\cap\mathfrak{q}_n$ whose radicals $\mathfrak{p}_1=\sqrt{\mathfrak{q}_1},\dots,\mathfrak{p}_n=\sqrt{\mathfrak{q}}_n$ are precisely the prime ideals which occur in the set $\{\sqrt{(\mathfrak{a}:x)}\mid x\in A\}$ where $(\mathfrak{a}:x):=\{y\in A\mid yx\in\mathfrak{a}\}$.
If you take a primary decomposition of the zero ideal in $A$ $$(0)=\mathfrak{q}_1\cap\dots\cap\mathfrak{q}_n$$ $$\mathfrak{p}_1=\sqrt{\mathfrak{q}_1},\dots,\mathfrak{p}_n=\sqrt{\mathfrak{q}_n}$$ we get that the set $D$ of zero divisors in $A$ $$
D=\bigcup\limits_{x\in A\diagdown\{0\}}\,(0:x)
$$ - which is evidently equal to its radical (an element is a zero divisor if an only if one of its powers is) $$
D=\sqrt{\bigcup\limits_{x\in A\diagdown\{0\}}\,(0:x)}=\bigcup\limits_{x\in A\diagdown\{0\}}\,\sqrt{(0:x)}
$$ - must be contained in the union $\mathfrak{p}_1\cup\dots\cup\mathfrak{p}_n$; conversely, each of the primes $\mathfrak{p}_1,\dots,\mathfrak{p}_n$ is made up of zero divisors since they're all of the form $\sqrt{(0:x)}$ for appropriate elements $x\in A$, whence $D=\mathfrak{p}_1\cup\dots\cup\mathfrak{p}_n$.
It follows that (since a primary decomposition of the zero-ideal in any localization $A_\mathfrak{p}$ is given by the intersection of the non-trivial extended primary ideals $(\mathfrak{q}_1)_\mathfrak{p}\cap\dots\cap(\mathfrak{q}_1)_\mathfrak{p}$) it follows that $A_\mathfrak{p}$ has no zero-divisors if and only each of the primes $\mathfrak{p}_1,\dots,\mathfrak{p}_n$ extends to the unit ideal in $A_\mathfrak{p}$, i.e. if and only if $\mathfrak{p}$ doesn't contain any of the primes $\mathfrak{p}_1,\dots,\mathfrak{p}_n$. In other words $Z=V(\mathfrak{p}_1\cap\dots\cap\mathfrak{p}_n)$.
Hope this helps and I didn't make any silly mistakes :p
