Something I was wondering about lately, suppose $\mathbb{A}_F^n$ is affine space over a field $F$ which is algebraically closed. When I say a quasi-affine set, I mean a set that is locally closed, so can be written as $Z_1\setminus Z_2$, where $Z_1$ and $Z_2$ are closed in $\mathbb{A}^n_F$.
Are the quasiaffine subsets $Z\subseteq\mathbb{A}_F^n$ always either open or closed, or is it possible to have some such subset that is neither?
If not, are there known dimensions $n$ for which all quasiaffine $Z\subseteq\mathbb{A}_F^n$ must be either closed or open?
I don't know what your definition is for "quasiaffine subset", but consider an example like $\{(x,0)\mid x\neq 0\} \subset \mathbb{A}^2$. The former can be identified with $\mathbb{A}^1 \setminus \{0\}$, which is quasi-affine (in fact, it's even affine). But it's not open or closed in $\mathbb{A}^2$.
Definitions really matter here, but hopefully this example resolves some of your confusion.