One-dimensional schemes in Neukirch I am working through the book "Algebraic Number Theory" by Neukirch.
In Chapter 1, §13, he claims that, given a one-dimensional domain $R$, the ring of regular function of an open set $U \subseteq \text{Spec}(R)$ equals the localization of $R$ at the multiplicative set $R \setminus \bigcup_{p \in U} p$.
Of course, one can cover $U$ by finitely many open sets on which the regular functions really are fractions, for instance basic open sets of the form $D(g)$, but I cannot see how the fractions can be "glued" to the whole of $U$.
I am not even sure whether the statement of Neukirch is really true. A possible mistake could be that he thinks that a prime ideal $q \notin U$ cannot be contained in $\bigcup_{p \in U} p$, which he claims before Corollary 11.2. But this is not true in general which is shown here.
Thank you for any help!
 A: Daniel's question is subtle, and the Hartshorne reference mentioned in the comments does not resolve it.  Neukrich's statement is that for one-dimensional integral domains, regular functions on $U$ (which usually would be patched together in local neighborhoods) can actually be defined "globally" on $U$ as a single quotient.
This is not true for general affine schemes; see What is an example of $\mathscr O_{Spec R}(U)\neq S^{-1}R$ for some $S$ consisting of the elements of $R$ not vanishing on $U$?.
Let $A$ be an integral domain, $X = \operatorname{Spec}(A)$ and $U$ an open set.  I suppose that what Neukirch had in mind was the following argument:
\begin{align*}
\mathcal{O}_X(U) &= \bigcap_{P \in U} \mathcal{O}_P \quad \text{(true since $A$ is a domain)}\\
&= \bigcap_{P \in U} \left\{ \frac{a}{g} : a \in A, g \notin P \right\}\\
&\stackrel{(*)}{=} \left\{ \frac{a}{g} : g \notin P \text{ for all } P \in U \right\}.
\end{align*}
Whilst the last equality appears reasonable, it is not always true!  You may have an element in $\operatorname{Frac}(A)$ that lies in the intersection of the stalks but can't be defined globally as an element $a/g$ with $g \notin P$ for all $P$ in $U$.  The $\stackrel{(*)}{=}$ should be replaced with $\supseteq$.
Under certain conditions Neukirch's claim is true.
Proposition 1.
Let $A$ be a one-dimensional Noetherian integral domain.  Suppose that for any nonzero prime ideal $Q$ of $A$, the prime ideal $Q$ is not contained in a union of all the other prime ideals, i.e.
$$Q \nsubseteq \bigcup_{P \neq Q} P \text{ for all nonzero } Q.$$
Then we have the equality
$$\mathcal{O}_X(U) = \left\{ \frac{a}{g} : g \notin P \text{ for all } P \in U \right\}.$$
Proof.
It suffices to prove this for $U$ a complement of a one point set $\{ Q \}$ for nonzero $Q$.  Since $Q$ is not contained in a union of the other prime ideals, there is an element $f \in Q$ which is not contained in any other prime ideal, so $V((f)) = Q$ and $U = D(f)$ is a basic open set.  Then
$$\mathcal{O}_X(U) = \mathcal{O}_X(D(f)) = A_f = \left\{ \frac{a}{f^n}: n \geq 0 \right\}.$$
The natural inclusion
$$A_f \longrightarrow \left\{ \frac{a}{g} : g \notin P \text{ for all } P \in U\right\}$$
is also a surjection; given such $a/g$, we have $V((g)) \subseteq V((f))$, so
$$(f) \subseteq \sqrt{(f)} \subseteq \sqrt{(g)}$$
so $f^n = bg$ for some $n \geq 0$ and $b \in A$.  Thus $ab / f^n$ in $A_f$ maps to $a/g$. $\Box$
UPDATED:
The conditions of the above proposition are satisfied not only by Dedekind domains with torsion class groups (such as rings of integers over number fields), but also by all non-maximal orders (see Wiegand's 1978 paper, Lemma 3).
Proposition 2 [Wiegand].
Let $A$ be a one-dimensional Noetherian domain with torsion Picard group, and let $Q$ be a nonzero prime ideal.  Then $Q$ is not contained in a union of all other prime ideals.
Proof.
First suppose that $Q$ is an invertible prime ideal.  Then $Q^n$ is a principal ideal for some $n > 0$.  Let $(f) = Q^n$.  Then $f \notin P$ for any prime ideal $P \neq Q$.
Next suppose that $Q$ is a noninvertible prime ideal.  There are only finitely many noninvertible prime ideals in $A$, so we can use the usual prime avoidance lemma to find $f \in Q$ such that $f$ is not contained any any other noninvertible prime ideal.  Using primary decomposition, we can write $(f)$ as an intersection of primary ideals,
$$(f) = I \cap J_1 \cap J_2 \cap \cdots \cap J_r = IJ,$$
where $\sqrt{I} = Q$ and $J = J_1 J_2 \cdots J_r$ is an invertible ideal.  Since the Picard group is torsion,  $J^n = (g)$ for some $n > 0$, and
$$(f^n) = I^n \cdot (g).$$
Since $A$ is a domain, $g$ is a nonzero divisor of $f^n$, so $I^n = (f^n g^{-1})$ is a principal ideal, and $f^n g^{-1} \in Q$ is not contained in any other prime ideal of $A$. $\Box$
On the other hand, if $A$ is a Dedekind domain with a nonzero prime ideal $Q$ which is non-torsion in the class group, we can explicitly construct an element of $\mathcal{O}_X(U)$ which does not lie in  $S^{-1}A$, where $S = A \setminus \bigcup_{P \in U} P$.
Let $U = X \setminus \{ Q \}$, and choose $P_1, P_2, P_3 \in [Q]^{-1}$.  Let $a, b, c, d$ be respective generators of the principal ideals $P_1 P_3, P_1 Q, P_2 P_3, P_2 Q$.  Since
$$(ad) = (bc) = P_1 P_2 P_3 Q$$
we have $ad = ubc$ for some unit $u$ of $A$.  Then
$$\frac{a}{b} = \frac{uc}{d} \in \mathcal{O}_P$$
for all $P \neq Q$.  On the other hand, since $Q$ is non-torsion in the class group, $Q$ is contained in the union of all other prime ideals $\bigcup_{P \neq Q} P$, so that $S^{-1} A = A$, and
$$\frac{a}{b} = \frac{uc}{d} \notin A.$$
Therefore $\mathcal{O}_X(U) \supsetneq S^{-1} A$.
