TITLE: What is a "subscheme"?
QUESTION [20 upvotes]: Every source I've looked at defines open subschemes and closed subschemes, but the definitions always look ad-hoc and not closely related to one another.  Are there other kinds of subschemes?  If not, can we give a definition for a "subscheme" and then deduce that the only ones that exist are open and closed subschemes?
For instance, EGA I, Definition 4.1.3, says (roughly):

We say a ringed space $(Y, \mathcal{O}_Y)$ is a subprescheme of a prescheme $(X, \mathcal{O}_X)$ if:

$Y$ is a locally closed subset of $X$, and
If $U$ denotes the largest open set of $X$ containing $Y$ and such that $X$ is closed in $U$, then $(Y, \mathcal{O}_Y)$ is a subprescheme of $(U, \mathcal{O}_X|_U)$ defined by a quasicoherent sheaf of ideals of $\mathcal{O}_X|_U$.


Is there some way to characterize this in terms of morphisms without having to build in the locally closed condition from the beginning?

REPLY [2 votes]: I think that there is no abstract nonsense answer. Locally closed immersions just arise naturally when one wants to study algebraic varieties. The local model looks as follows: We work in affine $n$-space $\mathbb{A}^n_k$ and consider not just closed subsets $\{x \in \mathbb{A}^n_k : p_1(x)=\dotsc=p_r(x) = 0\}$, but also allow inequalities by considering $\{x \in \mathbb{A}^n_k : p_1(x)=\dotsc=p_r(x) = 0 , f_1(x) \neq 0, \dotsc,f_s(x) \neq 0\}$. This is again an affine variety with coordinate ring $\{f_1,\dotsc,f_s\}^{-1} k[x_1,\dotsc,x_n]/(p_1,\dotsc,p_n)$. More generally, if $X$ is any scheme and $Z$ is a locally closed subset of the underlying set of $X$, then one may endow $Z$ with a scheme structure and the inclusion $Z \to X$ becomes a monomorphism of schemes. Of course one might try to characterize all those subsets with this property. Examples are infinite intersections of open affine schemes. Or one may try to characterize monomorphisms of schemes, see here for some information.