Let $A$ be a commutative ring and let $U$ be an open subset of $Spec(A)$. Let $B$ be the ring of sections above $U$ of the affine scheme $Spec(A)$. Pick a prime ideal $p\in U$. Then the natural map $A\to B$ induces an embedding between the localisations $A\_p\to B\_p$. I would like to know whether this map is surjective. I can show this in the case when $U$ is quasi-compact and in the case when $A$ is a reduced (aka 'semi-prime') ring. 


Equivalently, the question is as follows:
Given $s\in A$ with $D(s)\subseteq U$ and $f\in B$, if the restriction of $f$ to $D(s)$ is 0, then there is some integer $N$ with $s^N\cdot f=0$ (in $B$)


Here $D(s)$ is the set of all prime ideals of $A$ not containing $s$



Stalks of rings of sections of the Zariski sheaf
You are correct that this is nontrivial.


The natural map $B \to A\_p$ defines a map $B\_p \to A\_p$. The composition $A\_p \to B\_p \to A\_p$ is clearly the identity. This makes the surjectivity of $A\_p \to B\_p$ equivalent to the injectivity of $B\_p \to A\_p$, and also equivalent to both of those maps being isomorphisms.


The injectivity of $B\_p \to A\_p$ is the same as saying that any element in $B$ which is in the kernel of the natural map $B \to A\_p$, that, is, vanishes on some affine open neighborhood of $A\_p$, say $D(s)$, is a zero divisor with some element of $B$ which is not in $p$. It's not obvious to me that this element must be a power of $s$ - perhaps it could be some other element that does not vanish.


The naive proof of this only works if $U$ is quasicompact. It's also easy to extend this proof to the reduced case. Presumably the proof you found was roughly similar to this argument.


You can come up with slightly stronger conditions that include both the reduced and quasicompact cases that force this argument to work, basically a bound on how nilpotent things can get. For instance you can mandate that $U$ has a covering by affines of which all but finitely many are reduced. However none of these conditions are very satisfying.


It's easy to come up with an example of $f \in B$ whose stalk is trivial but is not a zero-divisor with a power of $s$. Just take $A=k[x\_1,x\_2,...,y\_1,y\_2,...]/((x\_ix\_j)^{i+j}(y\_i-y\_j))$. Let $U$ be the complement of the vanishing set of the ideal generated by all the $x\_i$. Let $f=y\_i-y\_1$ whenever $x\_i \neq 0$, then $f$ is well-defined by the sheaf condition, $f$ is zero on $D(x\_1)$, but $f$ is not a zero divisor with any power of $x\_1$. But it's not clear to me whether there is another function that $f$ is a zero divisor with.


