I'm not sure whether this is nontrivial or not, but do there exist simple examples of an affine scheme $X$ having an open affine subscheme $U$ which is not principal in $X$? By a principal open of $X = \mathrm{Spec} \ A$, I mean anything of the form $D(f) = \{\mathfrak p \in \mathrm{Spec} \ A : f \notin \mathfrak p\}$, where $f$ is an element of $A$.
Let X be an elliptic curve with the identity element O removed. Let U=XP where P is a point of infinite order. Then U is affine by a RiemannRoch argument. Now suppose that U=D(f). Then on the entire elliptic curve, the divisor of f must be supported at P and O only. This implies that P is a torsion point, a contradiction. 


For a simple, really concrete example you can also look at: $A=k[x,y,u,v]/(xy+ux^2+vy^2)$, $X =Spec(A)$, $I=(x,y)$, $U = D(I)$. Then the functions $f=\frac{v}{x}=\frac{y+ux}{y^2}$ and $g=\frac{u}{y}=\frac{x+vy}{x^2}$ are defined on $U$. But $yf+xg=1$, so $U$ is affine! Cheers, 


I just want to remark that there is a purely categorical characterization of the ideals $I \subseteq A$ such that the corresponding open subscheme $D(I) = V(I)^c$ of $\text{Spec}(A)$ is affine, namely that the ideal $I$ is codisjunctable. This means that there is a universal homomorphism $A \to B$ satisfying $IB=B$. This notion is studied in



I'm not entirely sure what you mean, but if you mean whose complement isn't principal, take $\mathbb{A}^2\setminus\{0\}$ which is an open subscheme of $\mathbb{A}^2$. Now, if you mean that the open subscheme isn't cut out by a single equation, any open subscheme other than the whole space will do for an irreducible scheme, because the only open set which is cut out by an ideal is the whole scheme. 


Jeez this thread is old but I found it useful. Here is another example: Consider the spectrum $X$ of a Dedekind domain. Remove a divisor with nontrivial class. Then this open set is nonprincipal in $X$. 

