Let $\mathrm{Spec}\,A$ be an open subset of $\mathrm{Spec}\, B$. Must $\mathrm{Spec}\, A$ be a distinguished open? Suppose we have a ring $A$, and an open subset $U\subseteq\mathrm{Spec}\, A$ such that $(U,\mathcal{O}_{\mathrm{Spec}\,A}\vert_U)$ is affine. Must $U=D(f)$ for some $f\in A$? The contrary is true, by a well-known theorem in basic algebraic geometry.
 A: Here is a counter example, see my comments above about its origin.
Let $$A=k[x,y,u,v]/(x^2u+y^2v-xy)$$
 Then in $A$ we have the relation 
$$x^2u+y^2v=xy$$
Let $$U=D(x)\cup D(y)$$
We must show 
$$\text{1) $U$ is affine.}$$
$$\text{2) $U \neq D(f)$ }$$
Note that $A$ is an integral domain, as $x^2u+y^2v-xy$ being linear in $u$ and $v$ is irreducible. Thus the definition of localization is simplified, maps between localizations are injective and $A_f\subseteq A_g$ iff $g|f$.
Next note that in any sheaf $\mathcal{F}$ with opens $V$ and $W$, $\mathcal{F}(V\cup W)$ is the pullback of $\mathcal{F}(V)$ and $\mathcal{F}(W)$ over $\mathcal{F}(V\cap W)$. Which means, taking into account that maps between localizations are injective, that 
$$\mathcal{O}_X(U)=\mathcal{O}_X(D(x))\cap \mathcal{O}_X(D(y))=A_x\cap A_y$$
Now to see that $U$ is affine note that 
$$\text{$D(x)=X_x=U_x$ is affine}$$
$$\text{$D(y)=X_y=U_y$ is affine}$$
and $$U=U_x\cup U_y.$$
Thus in order to apply the criteria for affineness we need only show that 
$x$ and $y$ generate the unit ideal in $A_x\cap A_y$.
This is a consequence of the equation
$$x\left(\frac{u}{y}\right)+y\left(\frac{v}{x}\right)=1$$
which is valid since
$$\frac{u}{y}=\frac{x-yv}{x^2}\in A_x\cap A_y$$
$$\frac{v}{x}=\frac{y-xu}{y^2}\in A_x\cap A_y$$
Thus $U$ is affine.
To see that $U\neq D(f)$ we must show that 
$$A_x\cap A_y\neq A_f$$ 
however $A_f\subseteq A_x\cap A_y$$ implies that
$$\text{$x=sf$ in $A$}$$
$$\text{$y=tf$ in $A$}$$
or 
$$\text{$x=sf+p(x^2u+y^2v-xy)$ in $k[x,y,u,v]$}$$
$$\text{$y=tf+q(x^2u+y^2v-xy)$ in $k[x,y,u,v]$}$$
which since the left had sides have degree $1$  gives $f\in k$, and thus $A_f=A$. However $A_x\cap A_y\neq A$ since the fraction $\frac{u}{y}$ is not in $A$.
