I apologize in advance for making a similar question to my previous one; as they pointed out in the comments, the question was not too clear because I am not used to the notions of locally ringed space. I would eliminate it but there is already an answer, so it would not be correct. Here, to be sure of knowing what I'm talking about, I'll just consider ringed spaces of functions, like Gathmann's notes do for example.
Let $k$ be a field, and for any set $S$ denote by $\mathrm{map}(S,k)$ the $k$-algebra of set maps $S\to k$. A ringed space of $k$-valued maps is a pair $(X,O_X)$ of a topological space $X$ and a sheaf $O_X$ of $k$-algebras on $X$, such that: $O_X(U) \subset \mathrm{map}(U,k)$ for any $U\subset X$ open, and for $V\subset U$ open, the restriction $O_X(U)\to O_X(V)$ is the usual restriction of maps. A morphism $(X,O_X)\to (Y,O_Y)$ of ringed spaces of $k$-valued maps is just a continuous map $f \colon X\to Y$ such that, for any $W\subset Y$ open and any $h\in O_Y(W)$, holds $h\circ f\in O_X(f^{-1}(W))$. Denote by $\mathrm{RS}_k$ this category of ringed spaces of $k$-valued maps.
Now, an affine variety over $k$ is a closed subspace of some $\mathbb{A}_k^n$ (with Zariski topology), with its sheaf of regular maps; so an affine variety over $k$ is an object of $\mathrm{RS}_k$, and the category $\mathrm{Aff}_k$ is the full subcategory of $\mathrm{RS}_k$ whose objects are the affine varieties over $k$. Let $k'$ be another field; if $X$ and $Y$ are affine varieties over $k$ and $k'$ respectively, how to define an arbitrary morphism $X\to Y$ in this setting? The notion of such a morphism requires a category containing $\mathrm{Aff}_k$ and $\mathrm{Aff}_{k'}$. E.g., if $k'\subset k$, one has a full inclusion $\mathrm{RS}_{k'}\subset\mathrm{RS}_{k}$, and I think that would make sense to define a morphism $X\to Y$ as one in $\mathrm{RS}_{k}$. But is there a category containing $\mathrm{Aff}_k$ and $\mathrm{Aff}_{k'}$ for any two $k$, $k'$? If yes, is it some $\mathrm{RS}_K$ for a field $K$? In general the tensor product of fields is not a field, but maybe if $k$, $k'$ have same characteristic $p$, then $k\otimes_{\mathbb{Z}_p}k'$ is always a field?
I have a question regarding (not affine) varieties also. A variety $(X,O_X)$ is an object of some $\mathrm{RS}_k$ by definition, admitting an open covering of $X$ such that, for any open $U\subset X$ of the covering, $(U,O_X|_U)$ is isomorphic in $\mathrm{RS}_k$ to an affine variety. However those in $\mathrm{Aff}_k$ are not the only affine varieties in $\mathrm{RS}_k$; e.g., also affine varieties over $k'\subset k$ are objects of $\mathrm{RS}_k$. Is there some convention on this?