Let $X$ be a smooth irreducible projective algebraic curve of genus $g\geq 1$ and $S=X^2$ the surface one obtains as the cartesian product of $X$ with itself. Let $\Delta$ be the diagonal in $S$, that is to say, a copy of $X$ embedded diagonally in $X^2$. 


Is the quasi-projective surface $U=S\setminus \Delta$ affine? 


One criterion for showing affinness is showing that $\Delta$ is an ample divisor in $S$. But the self-intersection of $\Delta$ is $\Delta^2=2-2g<0$ and therefore $\Delta$ can not be ample. Does this already imply that $U$ is not affine? I guess not.


Besides, Serre's criterion provides a necessary and sufficient condition for $U$ to be affine: this is the case if and only if $H^i(U,\mathcal F)=0$ for all $i>0$ and all coherent sheaves $\mathcal F$ on $U$. But I don't know how to check this in this example. 



Is the square of a curve minus its diagonal affine?
This answer is inspired by Rita's second paragraph.


It turns out that this $U$ contains projective curves for all $g\geq 1$ and hence cannot be affine:  

Embed $X$ into its Jacobian $X\hookrightarrow J$ and let $Z\subseteq J$ be the image of $X\times X$ via the map $J\times J\to J$, $(x,y)\mapsto x-y$. This contracts the diagonal of $X\times X$. If $g>1$, then $Z$ is singular, but still projective. Let $H\subset Z$ be a general hyperplane cut of $Z$ inside $J$ and $C\subset X\times X$ the preimage of $H$. By choice, $H$ avoids the image of $\Delta$ and hence the projective curve $C$ is contained in $U$.


