Value of the structure sheaf on a general open in Spec(R) Let $R$ be a commutative ring. Let $U\subseteq X:=\operatorname{Spec}(R)$ be an arbitrary open subset. Let $S$ be the multiplicative set of elements of $R$ which don't vanish anywhere on $U$. Explicitly, $U$ is open so by definition there exists some ideal $I\subseteq R$ such that $U$ is the prime ideals of $R$ which don't contain $I$, and then $S$ is the complement of the union of these prime ideals.
If $A:=\mathcal{O}_X(U)$ is the value of the structure sheaf at $U$, then restriction of functions gives us a map $R\to A$ and the image of every $s\in S$ is invertible in $A$ (because locally invertible) so we get a map $R[1/S]\to A$. 
What is an example where this map is not an isomorphism of rings? I have no reason to believe that it is an isomorphism in general, but (a) if $U=D(f)$ (that is, $I=(f)$) then it is an isomorphism, and (b) if $X$ is affine 2-space over a field $k$ and $U$ is the complement of the origin -- the canonical "non-affine open in an affine" -- then $S$ is the non-zero constants and $R[1/S]=k[x,y]=A$. I need to expand my mental store of examples/counterexamples to answer this one, I think. Can someone help?
 A: Here is the simplest example that I know.  Let $R$ be $k[x,y,z]/\langle xy \rangle$.  Let $I$ be $\langle \overline{x}(1+\overline{z}), \overline{y}(1-\overline{z}),\overline{z}^2-1 \rangle$.  Then $S$ equals $k^\times$.  Yet $A$ is the following countably generated $R$-algebra, $$A=R[u_n,v_n : n\in \mathbb{Z}_{\geq 0}]/J, $$ $$ J := \langle \overline{y}-u_0,  (\overline{z}-1)u_{n+1}-u_n, \overline{x}-v_0, (\overline{z}+1)v_{n+1}-v_n, u_nv_n : n\geq 0 \rangle.$$
A: An even easier example than the two current answers is the following. (See also this MO answer.)
Example. Let $E$ be an elliptic curve over an algebraically closed field $k$. Let $O \in E(k)$ be the origin, and $P \in E(k)$ a non-torsion point. Let $X = E \setminus \{O\}$ and $U = X \setminus \{P\}$.
If $f \in S$ (i.e. $f \in R = \Gamma(X,\mathcal O_X)$ becomes invertible on $U$), then $\operatorname{div}(f) \subseteq E$ has to be supported on $\{O,P\}$. Because $P$ is non-torsion, the only way this can happen is if $\operatorname{div}(f) = 0$, i.e. $f \in k^\times$. We conclude that $S = R^\times = k^\times$, so $R[1/S] \cong R$. But $\Gamma(U,\mathcal O_U)$ is not isomorphic to $R$. $\square$
This is the canonical "affine open that is not standard affine open".
A: The map is not always an isomorphism (assuming there is no stupid mistake in my judgment). If you take an arbitrary commutative unital Noetherian ring and localize it at an arbitrary multiplicative set, the resulting ring is Noetherian (see here). If the map in question is always an isomorphism, then for a Noetherian $R$ and any open set $U\subset X=\mathrm{Spec}\,R$, the ring $\mathcal{O}_X(U)$ would be Noetherian. This need not be true. See Remark 3.7.b in this paper. You also may find this paper useful.
