Assume we have $K$ and $L$ (comm.) rings, and we have a functor $F$ from the category of $K$-Algebras to the category of $L$-Algebras (I work only with commutative rings). What conditions need to satisfy this functor in order to "extend" to a functor $F^\*$ form the category of $\operatorname{Spec}(L)$-Schemes to the category of $\operatorname{Spec}(K)$-Schemes?


It is clear that the extension, if it exists, is unique, by Yoneda's lemma.


On the other hand, I am not sure any functor will work; it seems to me we need that the functor sends "open affine immersions" to "open affine immersions", i.e. flat morphisms $g:R\to S$ of finite presentation which are epimorphism, to the same type of morphisms, in order to be able to "patch" the image of an affine covering of a $\operatorname{Spec}(L)$-scheme to get a $\operatorname{Spec}(K)$-scheme. But I don't see how to do it if the intersections are not affine, and one needs to get an affine covering of the intersections, and so on. Moreover, I don't know if it is sufficient to show this for principal open schemes, so for maps of the type $g:R\to R[1/a]$ for $a\in R$.


I am interested, for example, in the functor sending any ring $R$ to its total ring of fractions $Q(R)$. I have not seen this mentioned in the scheme world. But such a general result, if it exists in the literature, could be useful to get e.g. the base change functor, or the reduced subcheme functor, etc.



Extending functors between K-algebras to schemes
You are talking about *descent*. As you suggest in the last paragraph it is very useful in algebraic geometry.


I would prefer to reverse the question: instead of starting with a functor defined on affine schemes and trying to extend it to all schemes, you can consider a functor defined on all schemes and ask whether it can be uniquely reconstructed from its restriction to affine schemes. Also, the fact that the target category happened to be schemes in your question is not really important. So we may choose any functor $F \colon \mathrm{Sch}^{op} \to C$, where $C$ is any category, and ask if it is determined by its restriction to $\mathrm{Aff}^{op} \to C$.


The natural condition that implies this is that $F$ is a sheaf for the Zariski topology on $\mathrm{Sch}$, i.e. if $X = \bigcup U\_i$ is a Zariski open cover of a scheme $X$ then $F(X)$ is the equalizer of the two maps $\prod\_i F(U\_i) \to \prod\_{i,j} F(U\_i \cap U\_j)$. Let's assume that $C$ has all limits, so the products and equalizer exist. In this case there's an equivalence of categories between functors $\mathrm{Sch}^{op} \to C$ satisfying the sheaf condition for Zariski open covers, and functors $\mathrm{Aff}^{op} \to C$ satisfying the same sheaf condition. Moreover, as suggested in your question, both are also equivalent to functors $\mathrm{Aff}^{op} \to C$ satisfying the sheaf condition for open covers by principal open subsets.


These equivalences are a simple instance of the "comparison lemma" in topos theory.


