**Main Theorem**: Let $\text{ValSp}$ be the category of ringed spaces whose stalks are valuation rings, which I call valuation ringed spaces. We assume that all valuation-ringed spaces are irreducible here, and have $\text{limit}_{U \subset X \text{ dense}} \mathcal{O}_X (U)$ a field, but this can be made to work in more general situations. Consider the functor $\text{Rat}$, the rational functions functor, from $\text{ValSp}$ to $\text{Rng}$, which assigns to a valuation ringed space $X$ the ring $\text{Rat}(X) := \text{colimit}_{U \subset X \text{ nonempty}} \mathcal{O}_X (U)$, where the colimit is taken over dense open sets of $X$, and acts on morphisms in the canonical way. $\text{Rat}$ is right adjoint to $\text{Spv}$.

In the first section I develop the tools to make things precise. In the second section I prove the theorem. I actually prove the theorem for fields. The theorem for rings holds, but takes a little more work.

**To anyone who would like to improve this answer, the bounty is still open. My feeling is that the bounty should not go to waste**

**Definition**: Let $K$ be a field. For $a_1, ..., a_n \in K$, let
$$V(a_1, ..., a_n) = \{ R \text{ a valuation ring in } K : a_1, ..., a_n \in R \}$$
All valuations on $K$ are contained in $V(1)$. The sets $\{ V(a_1, ..., a_n) : a \in A \}$ are closed under intersection, as $V(a_1, ..., a_n) \cap V(b_1, ..., b_n) = V(a_1, ..., a_n, b_1, ..., b_n)$. So the sets $\{ V(a_1, ..., a_n) : a_1, ..., a_n \in A \}$ form the base for a topology on the set of valuation rings of $A$. Write $\text{Spv}(K)$ for the topological space on the set of valuation rings of $K$ with basis $\{ V(a_1, ..., a_n) : a_1, ..., a_n \in K \}$. A reference for this construction can be found here.

**Lemma:** Let $K$ be a field, and take $f_1, ..., f_n, g_1, ..., g_n \in K$. Then $V(g_1, ..., g_n) \subset V(f_1, ..., f_n)$ if and only if $E(f_1, ..., f_n) \subset E(g_1, ..., g_n)$, where we write $E(f_1, ..., f_n)$ for the integral closure of the ring generated by $f_1, ..., f_n$ in $K$.

**Proof:** First suppose that $V(g_1, ..., g_n) \subset V(f_1, ..., f_n)$. Then any valuation ring containing $g_1, ..., g_n$ contains $f_1, ..., f_n$. Hence the intersection $E(g_1, ..., g_n)$ of all valuation rings containing $g_1, ..., g_n$ contains $f_1, ..., f_n$, so that it contains $E(f_1, ..., f_n)$.

Conversely, suppose $V(g_1, ..., g_n) \not\subset V(f_1, ..., f_n)$. Then there is some valuation ring $R$ of $K$ containing $g_1, ..., g_n$ and not containing one of $f_i$. Hence the intersection $E(g_1, ..., g_n)$ of all valuation rings containing $g_1, ..., g_n$ does not contain $f_i$, and in particular does not contain the integral closure $E(f_1, ..., f_n)$ of the ring generated by the $f_i$.

**Definition**: Let $K$ be a field. We make $\text{Spv}(K)$ into a presheaf, for each open set $U \subset \text{Spec}(K)$, $\text{Spv}(K)^\# (U) = \{ a \in K : a \in R \forall R \in U \}$.

In fact, $\text{Spv}(K)$ is a sheaf. $\text{Spv}(K)^\# (V(f_1, ..., f_n))$ can be identified with $E(f_1, ..., f_n)$. The stalk of $\text{Spv}(K)$ at a valuation $R \subset K$ is $R$, which is a local ring. In particular, $\text{Spec}(K)$ is a locally ringed space.

**Definition:** (The Valuation Spectrum Functor) We make $\text{Spv}$ into a contravariant functor from $\text{Fld}$ to $\text{ValSp}$ as follows: let $f : K \rightarrow L$ be a morphism of fields. As a map of topological spaces, we define $\text{Spv}(f) : \text{Spv}(L) \rightarrow \text{Spv}(K)$ to send a valuation ring $R \in \text{Spv}(L)$ to $f^{-1} (R)$ in $\text{Spv}(K)$. For each open set $V(a_1, ..., a_n)$ of $\text{Spv}(K)$, $\mathcal{O}_{ \text{Spv}(K)}(V(a_1, ..., a_n)) = E(a_1, ..., a_n)$, and $\text{Spf}(f)^{-1} (V(a_1, ..., a_n)) = V(f(a_1), ..., f(a_n))$, so that
\begin{align*}
&\ \mathcal{O}_{\text{Spv}(L)} ( \text{Spf}(f)^{-1} (V(a_1, ..., a_n))) \\
=&\ \mathcal{O}_{\text{Spv}(L)}(V(f(a_1), ..., f(a_n))) \\
=&\ E(f(a_1), ..., f(a_n))
\end{align*}
We define $\text{Spv}(f)^\# (V(a_1, ..., a_n)) : E(a_1, ..., a_n) \rightarrow E(f(a_1), ..., f(a_n))$ to be the map induced by the map $f: K \rightarrow L$.

**Definition:** We define a contravariant functor $\text{Rat} : \text{ValSp} \rightarrow \text{Fld}$, called the rational functions functor. For a valuation ringed space $X$, we set $\text{Rat} (X) = \text{colimit}_{U \text{ dense in } X } \mathcal{O}_X (U)$. For a map $f : X \rightarrow Y$ in $\text{RngSp}$, there is a cone $\mathcal{O}_Y (U) \rightarrow \text{Rat}(X)$, where $U$ ranges over open sets of $Y$ dense in $Y$. By the universal property of colimit, there is a map $\text{Rat}(Y) \rightarrow \text{Rat}(X)$, and we set $\text{Rat}(f)$ to be this map.

Now I estalish the claimed adjunction.

**Definition:** (The first unit of the adjunction) For each field $K$, we may identify $\text{Rat}(\text{Spv}(K))$ with $K$ itself. Hence $\text{Rat} \circ \text{Spv}$ is the identity functor. In particular, we set $\eta : 1_{\text{Fld}} \rightarrow \text{Rat} \circ \text{Spv}$ to be the identity natural transformation.

**Definition:** (The second unit of the adjunction) We define a natural transformation $\theta : 1_{\text{FldSp}} \rightarrow \text{Spv} \circ \text{Rat}$ as follows. Take a locally ringed space $X$ such that $\text{Rat}(X)$ is a field, and let $Y = \text{Spv}(\text{Rat}(X))$. We define $\theta_X : X \rightarrow Y$ as follows. For a point $x \in X$, let $\theta_X (x)$ be the integral closure of the stalk $\mathcal{O}_{X, x}$ in $\text{Rat}(X)$, which is necessarily a valuation ring and hence a point in $Y$. For an open set $U$ in $\text{Rat}(X)$, define $\theta_X^\#(U) : \mathcal{O}_{Y}(U) \rightarrow \mathcal{O}_X(\theta_X^{-1} (U))$ to be the unique map making the following diagram commute:

**Proposition:**

(i) $\theta * \text{Spv} : \text{Spv} \rightarrow \text{Spv} \circ \text{Rat} \circ \text{Spv}$ is the identity natural transformation.

(ii) $\text{Rat} * \theta : \text{Rat} \circ \text{Spv} \circ \text{Rat} \rightarrow \text{Rat}$ is the identity natural transformation.

**Proof:** (i) Let $K$ be a field and put $X = \text{Spv}(K)$. Now $\text{Rat}(X) = K$ and $\text{Spv}(\text{Rat}(X)) = \text{Spv}(K) = X$. As a map of topological spaces, $\theta_X : X \rightarrow X$ sends a point $R \in X$ to the integral closure of $R = \mathcal{O}_{X, x}$ in $K$. But this is identically $\mathcal{O}_{X, x}$, as valuation rings are integrally closed. So $\theta_X : X \rightarrow X$ is the identity map. Hence, for each open set $U$ in $X$, $\mathcal{O}_X (\theta_X^{-1} (U)) = \mathcal{O}_X (U)$. For each open set $D(f)$ in $X$, $\theta_X^\#$ is the unique map making the diagram below commute:

And so $\theta_X^\#$ must be the identity map.

(ii) Let $X$ be a valuation ringed space such that $\text{Rat}(X)$ is a field. Put $Y = \text{Spv}(\text{Rat}(X))$. Then $\text{Spv}(X) = \text{Spv}(Y)$. The following diagram commutes for each open set $U$ of $Y$:

This commutativity shows that $\text{Rat}(Y) \rightarrow \text{Rat}(X)$ is the canonical map in the colimit; $\theta_X^\# : \mathcal{O}_Y \rightarrow (\theta_X)_* \mathcal{O}_X$ induces the identity map $\text{Spv}(X)$ after applying $\text{Rat}$.

**Theorem:** The contravariant functors $\text{Spv}: \text{Fld} \rightarrow \text{FldSp}$ and $\text{Rat} : \text{FldSp} \rightarrow \text{Fld}$ are right adjoint to each other.

**Proof:** With $\eta : 1_C \rightarrow \text{Rat} \circ \text{Spv}$ the identity natural transformation, $\text{Spv} * \eta : \text{Spv} \rightarrow \text{Spv} \circ \text{Rat} \circ \text{Spv}$ and $\eta * \text{Rat} : \text{Rat} \rightarrow \text{Rat} \circ \text{Spv} \circ \text{Rat}$ are the identity natural transformations. $\text{Rat} * \theta$ and $\theta * \text{Spv}$ are the identity natural transformations. So we have the triangle identities: $\text{Spv} * \eta \circ \theta * \text{Spv} = 1_{\text{Spv}}$ and $\text{Rat} * \theta \circ \eta * \text{Rat} = 1_{\text{Rat}}$. We can conclude that $\text{Spv}$ and $\text{Rat}$ are right adjoint to each other.

If anyone wants to complete writeups of the smaller gaps, I will also give them the bounty for this question.

ii) in Huber's "A generalization of formal schemes and rigid analytic varieties". I don't know what happens for $\operatorname{Spv} A$, however. Is there a commonly accepted definition for the structure sheaf on $\operatorname{Spv} A$? $\endgroup$ – Takumi Murayama Mar 5 at 4:45