TITLE: separated schemes
QUESTION [24 upvotes]: Here's a dangerous question:
We all know that a variety is an integral scheme, separated and of finite type over an algebraically closed field. Now, if I remove the separated hypothesis, I get the class of schemes which are made by gluing together (finitely many) classical affine varieties and applying the famous fully faithful functor $Var_k \longrightarrow Schemes_k$. Thus, separatedness must relate somehow to the "way of gluing" together these affine varieties, (which is kind of confirmed when you look at the uber-classical example of the double line). Is there someone here that can explain what way of gluing we ban when restricting to separated schemes ?

REPLY [16 votes]: The necessary and sufficient condition on a schemes $\{U_i\}$ and gluing isomorphisms $\varphi_{ij}:U_{ij} \simeq U_{ji}$ between opens $U_{ij} \subset U_i$ ($i, j \in I$) that the gluing $X$ be separated is that the graph map $U_{ij} \rightarrow U_i \times U_j$ defined by $u \mapsto (u, \varphi_{ij}(u))$ is a closed immersion (or equivalently, has closed image) for all $i, j$.  This is seen by intersecting $\Delta(X)$ with the opens $U_i \times U_j$ that cover $X \times X$. 
(Taking $i=j$, this says that all $U_i$ are separated, which is automatic when all $U_i$ are affine; in such cases the closed immersion condition forces all $U_{ij}$ to also be affine, so in the context of the question one loses nothing by requiring all $U_{ij}$ to be affine open prior to stating the closed immersion condition.)

REPLY [7 votes]: Basically it's the sort of gluing that would violate the (discrete) valuative criterion for separatedness.  See Chapter II, Section IV of Hartshorne for example.
For example, if you are gluing $U$ to $V$ (say separated noetherian schemes) along a common open subscheme $W$, if you want the result to be separated, you presumably want to require that:
For every spec of a DVR, $Z =$ { generic Pt, closed Pt } with a map $Z \to U$ such that,
the generic point of $Z$ is sent into $W$, then the closed point of $Z$ is also sent to $W$ as well whenever the map {generic Pt} $\to W$ extends to a map $Z \to V$.