$\DeclareMathOperator\Spec{Spec}$Actually, your suggested categorical characterization of spectra of fields does work.
Edit: (I had written something incorrect here)
By Martin's comment below, we just have to show that maps from affines into $\Spec(k)$ are epis in the full category. But if we had two maps $f,g: \Spec(k) \rightarrow Y$ which agreed on some affine mapping into $\Spec(k)$, then first of all $f$ and $g$ would have to be the same topological map. Then both would land inside some affine $\Spec(R)\subset Y$, and now we're
reduced to the affine situation where we know it holds.
Conversely, suppose $X$ is not the spectrum of a field. If every point is dense, $X$ is affine
and we are done by what we know about the affine subcategory. Otherwise, we can find an open subscheme $U\subsetneq X$. Then the inclusion of $U$ into $X$ is not an epi as is witnessed by the two inclusions
$$X \rightrightarrows X\sqcup_U X,$$
where the last object is $X$ glued to itself along $U$.
As requested by the OP in the comments of the (correct and complete) accepted answer of user131755: it's possible to say more.
Theorem [Mochizuki 2004, vDdB 2019]. Let $S$ and $S'$ be schemes. Then the natural functor
$$\operatorname{Isom}(S,S') \to \mathbf{Isom}(\mathbf{Sch}_{S'},\mathbf{Sch}_S)$$
is an equivalence of categories, where $\operatorname{Isom}(S,S')$ is a discrete category and $\mathbf{Isom}$ denotes the category whose objects are equivalences and whose morphisms are natural isomorphisms.
The version where $\mathbf{Sch}$ denotes the category of locally Noetherian schemes with finite type morphisms is due to Mochizuki [Mochizuki 2004], and the general statement appears in a preprint of myself [vDdB 2019].
In particular, taking $S = S' = \operatorname{Spec} \mathbf Z$ answers the question, since $\operatorname{Aut}(\operatorname{Spec} \mathbf Z) = 1$.
Some ideas of the proof.
Here is a broad overview of the proof; more details can be found in [vDdB 2019]. As will become clear, most of the ideas were already present in some form, but there were some key tricks missing.
1. Underlying set.
The underlying set of $X \in \mathbf{Sch}_S$ is reconstructed as the set of isomorphism classes of simple subobjects.
2. Topology.
Although we don't know if regular monomorphisms in $\mathbf{Sch}$ are the same as (locally closed) immersions (see also this question), we do know:
- Every open immersion is a regular monomorphism;
- Every closed immersion is a regular monomorphism;
- Every regular monomorphism is an immersion.
Thus, a morphism $f \colon X \to Y$ is an immersion if and only if it can be written as a composition of two regular monomorphisms.
Next, one shows:
Proposition. Let $(X,x)$ be a pointed scheme. Then $(X,x) \cong (\operatorname{Spec} R, \mathfrak m)$ for a valuation ring $R$ with maximal ideal $\mathfrak m$ if and only if all of the following hold:
- $X$ is reduced and connected;
- the category of immersions $Z \hookrightarrow X$ containing $x$ is a linear order;
- there exists a subset $V \subseteq |X|$ that is the support of infinitely many pairwise non-isomorphic immersions $Z \hookrightarrow X$ containing $x$.
Together with the characterisation of immersions, this leads to categorical criteria for closed immersions and open immersions in $\mathbf{Sch}_S$.
3. Quasi-coherent sheaves.
A variant of the Beck cogroup argument (see also user131755's post) realises nilpotent thickenings $\mathbf{Spec}_X(\mathcal O_X \oplus \mathscr F) \to X$ as cogroups in $X/\mathbf{Sch}_X$. This gives (loosely speaking) a pseudofunctor
\begin{align*}
\mathbf{Sch}_S &\to \mathbf{Cat}^{\operatorname{op}}\\
X &\mapsto \mathbf{Qcoh}(\mathcal O_X),
\end{align*}
reconstructed from $\mathbf{Sch}_S$ using only categorical data.
4. The structure sheaf.
Now we run an enhanced version of this argument of the OP (that took place in the ring setting). We would like to say that the '(pre)sheaf End' $\mathscr End(\mathbf{Qcoh}(\mathcal O_{-}))$ on $\mathbf{Sch}_S$ is isomorphic to the structure (pre)sheaf $\mathcal O$ on the big Zariski site $\mathbf{Sch}_S$.
This is possible, but the difficulty is to say what exactly this presheaf End (or really prestack End) should be (also since it all takes place on the big Zariski site $\mathbf{Sch}_S$, not just the small Zariski site $S$).
5. Proof of main theorem.
By 2 and 4 above, we have reconstructed from $\mathbf{Sch}_S$ the topology on $|S|$ together with its structure sheaf $\mathcal O_S$. This gives (roughly speaking) some sort of lax functor of $2$-categories
\begin{align*}
\{\text{categories equivalent to } \mathbf{Sch}_S \text{ for some } S\} &\to \mathbf{Sch}\\
\mathbf{Sch}_S &\mapsto S.
\end{align*}
But in fact the reconstruction of the scheme $X \in \mathbf{Sch}_S$ (with its structure morphism $X \to S$) from categorical data in $\mathbf{Sch}_S$ is functorial in $X$. With some work, this shows that this lax functor is a lax inverse of $S \mapsto \mathbf{Sch}_S$. $\square$
(Because I don't really speak $n$-category, I phrase the last part a little differently in my paper.)
References.
[vDdB 2019] Remy van Dobben de Bruyn, Automorphisms of categories of schemes, 2019. Submitted. arXiv:1906.00921.
[Mochizuki 2004] Shinichi Mochizuki, Categorical representation of locally Noetherian log schemes. Adv. Math. 188.1, p. 222-246 (2004). ZBL1073.14002.
Best Answer
For a category $\mathcal{C}$, let $\mathcal{C}'$ denote the full subcategory of $\mathcal{C}$ whose objects are the non-terminal objects of $\mathcal{C}$.
In a category, say that an object $Y$ is final if for every object $X$ there exists an epimorphism $X\to Y$.
In turn, say that an object of $\mathcal{C}$ is pre-final if it is a final object of $\mathcal{C}'$.
Then say that an object $Y$ of $\mathcal{C}$ is pseudo-Hausdorff if $\mathrm{Hom}(X,Y)$ is reduced to a singleton for every pre-final $X$.
Then in the category $\mathcal{C}$ of locally convex spaces (and also topological vector spaces over an arbitrary Hausdorff field), the terminal objects are those spaces reduced to $\{0\}$. In both $\mathcal{C}$ and $\mathcal{C}'$, epimorphisms are just surjective maps (this uses the existence of non-Hausdorff objects). In turn, the pre-final objects are those 1-dimensional non-Hausdorff spaces. And the pseudo-Hausdorff objects are then the Hausdorff spaces.