Let $X=Spec(A)$ be an affine scheme and $U=Spec(R)$ be an affine open subset of $X$. Is it true that $R$ is an localization of $A$, i.e. $R=S^{-1}A$ for some closed multiplication subset $S\subset A$ ? 



affine open subset of affine scheme
No. This question is pretty closely related to  [this other question](https://mathoverflow.net/questions/47783/can-a-curve-intersect-a-given-curve-only-at-given-points), but let me give an answer nonetheless:


Consider an elliptic curve $E$ in $\mathbb{P}^2(\mathbb{C})$, choose coordinates $[x:y:z]$ of $\mathbb{P}^2(\mathbb{C})$ in a way that the line $z = 0$ intersects $E$ at an inflection point $O$. Let $X := E \setminus \lbrace z = 0 \rbrace$. Choose a point $P \in E$ such that $P$ is not a torsion point with respect to the group structure on $E$ for which $O$ is the origin. Let $U := X \setminus \lbrace P \rbrace$. Then $U$ is an open affine subset of $X$, but there is no $f \in A:=\mathbb{C}[X]$ that vanishes only at $P$. So $\mathbb{C}[U]$ cannot contain $A\_f$ for any non-constant $f \in A$. 


