Regular functions on affine schemes I'm just learning the language of schemes, so I'm sorry if this seems a little elementary.  Consider an affine scheme $\text{Spec}(R)$.  For an ideal $I$ of $R$, denote by $U(I)$ the open subset of $\text{Spec}(R)$ consisting of prime ideals $p$ that do not contain $I$.
Is the ring of regular functions on $U(I)$ simply $R_I$ (the localization of $R$ with respect to $I$)?  If $I$ is a principal ideal, then this is one of the earliest results in Hartschorne.  Also, it is easy to see that $R_I$ injects into the ring of regular functions on $U(I)$.  My guess is that this injection is not surjective, but I can't seem to come up with any examples.  Thanks!
 A: I think a good reference might be Eisenbud-Harris, Geometry of Schemes. They construct the structure sheaf $\mathcal{O}$ by specifying it on principal open subsets (viz. the 'important' ones) and extending it uniquely to other open subsets.
On a given ring $R$, you have a basis of open sets of Spec $R$ consisting of the $\text{D}(f)$'s.
($D(f) = Spec R - V(R\cdot f)$, where $R\cdot f$ stands for the ideal generated by $f$).
With each $D(f)$ we associate the localization $R_f$.
With a general open subset $U$ we associate the inverse limit of the $R_f$, for $D(f) \subseteq U$.
More concretely, if $U = Spec R - V(I)$, then $D(f) \subseteq U$ if and only if $V(I) \subseteq V(R\cdot f)$ if and only if $f \in \sqrt{I}$. So $\mathcal{O}(U)$ is the inverse limit of the rings $R_f$, for $f \in \sqrt{I}$.
http://en.wikipedia.org/wiki/Inverse_limit
A: Well, even if $I$ is a prime ideal, elements of $R_I$ are NOT in general regular functions on $U_I$. For example if $I = \langle x, y \rangle$ in $\mathbb{C}[x,y]$ then $f := 1/(1+x) \in R_I$, but clearly $f$ is not regular everywhere on $\mathbb{C}^2\setminus\{(0,0)\}$.  
