How to reduce to affine case to determine whether a given functor is representable [Definition] These are the contents of Gortz and Wedhorn , Algebraic Geometry.

*

*$\widehat{(Sch)}$ is the category of functors $(Sch)^{opp} \rightarrow (Sets)$


*For scheme $X$, define the functor $h_X := Hom(\_\_ , X)$ and identify $X$ with $h_X$ in $\widehat{(Sch)}$


*A morphism $f : F \rightarrow G$ of functors in $\widehat{(Sch)}$ is called representable if for all schemes $X$ and all morphisms $g : X \rightarrow G$ in $\widehat{(Sch)}$  the functor $F \; {\times_G} X$ is representable


*An open subfunctor $F'$ of $F$ is a representable morphism $f:F' \rightarrow F$ that is an open immersion.


*A family $(f_i:F_i \rightarrow F)_{i \in I}$ of open subfunctors is called a Zariski open covering of $F$ if for every $S$-scheme $X$ and every $S$-morphism $g:X \rightarrow F$ the images of the $(f_i)_{(X)}$ form a covering of $X$, where $(f_i)_{(X)} : F_i \; \times_F X \rightarrow X $ is the second projection map of fiber product.


*[Theorem 8.9] Let $S$ be a scheme and $F:(Sch/S)^{opp} \rightarrow (Sets)$ be a functor such that
 (i) $F$ is a sheaf for the Zariski topology (ii) $F$ has a Zariski open covering $(f_i:F_i \rightarrow F)_{i \in I}$ by representable functors $F_i$. Then $F$ is representable.


*[Theorem 11.1] Let $X$ be a scheme and let $\mathscr{R}$ be a quasi-coherent $\mathscr{O}_{X}$-algebra. Then there exsist an $X$-scheme $\text{Spec}(\mathscr{R})$ which is represents the functor
$$ F: (Sch/X)^{opp} \rightarrow (Sets), \hspace{1cm} (f:T \rightarrow X) \mapsto \text{Hom}_{(\mathscr{O}_X-Alg)}(\mathscr{R},f_{*}\mathscr{O}_T)$$

[Question]
In the proof of the theorem 11.1 , they say that " To show that $F$ is representable, by theorem 8.9 we may assume that $X=\text{Spec}{A}$ is affine."
I wonder how I can exactly take a family of open subfunctors $(f_i:F_i \rightarrow F)_{i \in I}$ so that we can assume $X$ is affine.
Let $X = \bigcup U_i$ and $U_i = \text{Spec}A_i$.
$$ F_i: (Sch/X)^{opp} \rightarrow (Sets), \hspace{1cm} (f:T \rightarrow X) \mapsto \text{Hom}_{(\mathscr{O}_{U_i}-Alg)}(\mathscr{R}\vert_{U_i},f_{*}\mathscr{O}_T)$$
Then, are these $F_i$ open subfunctors of $F$ ?
I can't prove this $(f_i:F_i \rightarrow F)_{i \in I}$ is a Zariski open covering of $F$
 A: Here's a rewritten answer for better comprehension. I also apologise for the delay in responding, I was very busy for various reasons.
The answer below is long, but fills in most of the details.
Objective- We want to show that given a scheme $X$ and $\mathcal{B}$ a quasi-coherent $\mathcal{O}_X$-algebra, we want to show that the contravariant functor on $\operatorname{Sch}_{X}$ which sends any $X$-scheme $f\colon T\to X$ to the set $$F(T)\colon= \operatorname{Hom}_{\mathcal{O}_X-\text{Alg}}(\mathcal{B},f_*\mathcal{O}_T)$$ is in fact representable.
I will leave the verification that this functor is a Zariski sheaf as an exercise.
Observation 1- Let's note that this functor is affinely representable.
This means that if $X=\operatorname{Spec}(A)$ for some ring $A$ and $B$ an algebra over $A$, then the functor on $\operatorname{Sch}_X\to \operatorname{Sets}$ which sends
$$\big(f\colon T\to X \big)\mapsto \operatorname{Hom}_{A-\text{Alg}}(B,\Gamma(T,\mathcal{O}_T))$$ is representable. In this case it is representable by $\operatorname{Spec}(B)$.
This is Exercise $2.4$ in Hartshorne in the aboslute case (i.e. when $A=\mathbf{Z}$) and Prop $3.4$ in Gortz-Wedhorn in the relative case. You can also probably find it somewhere in the Stacks Project.
Observation 2- Now let $X$ be a general scheme and let $j\colon U \hookrightarrow X$ be an affine open subscheme of $X$.
Let us try to understand the category $\operatorname{Sch}_U$ in terms of $\operatorname{Sch}_X$. Note that there is a functor $j_!\colon \operatorname{Sch}_U\to \operatorname{Sch}_X$ which sends every $U$-scheme $g\colon S\to U$ to an $X$-scheme via the composition $$j\circ g\colon S\to U\hookrightarrow X.$$
Conversely, every $X$ scheme $f\colon T\to X$ for which the structure morphism factors as $T\to U\hookrightarrow X$ is canonically a $U$-scheme. Thus $$j_!\colon \operatorname{Sch}_U\to \operatorname{Sch}_X$$ embeds $\operatorname{Sch}_U$ as a full subcategory of $\operatorname{Sch}_X$.
Observation 3- Now note that since $\mathcal{B}$ is a quasi-coherent $\mathcal{O}_X$-algebra, it's restriction $\mathcal{B}|_U$ to $U$ is a quasi-coherent $\mathcal{O}_U$-algebra. Since $U$ is affine $\mathcal{B}|_{U}=\Gamma(U,\mathcal{B})$ which is an algebra over $\Gamma(U,\mathcal{O}_U)$.
So consider the functor $F_U(-)\colon \operatorname{Sch}^{op}_U\to \operatorname{Sets}$ which sends $$\big(g\colon S\to U \big)\to \operatorname{Hom}_{\mathcal{O}_U-\text{Alg}}(\mathcal{B}|_{U},g_*\mathcal{O}_S).$$
By Observation $1$, this functor is representable by $\operatorname{Spec}(\Gamma(U,\mathcal{B}))$ since $U$ is affine.
Composing $F_U$ with $j_!$ of Observation $2$, we see that $$F_U\circ j_!\colon \operatorname{Sch}^{op}_U\to \operatorname{Sch}^{op}_X\to \operatorname{Sets}$$ is a functor on the full subcategory $\operatorname{Sch}_U$ of $\operatorname{Sch}_X$ and we extend it to a functor on all of $\operatorname{Sch}_X$ by sending everything not in $\operatorname{Sch}_U$ to $\emptyset$.
This defines a functor on $\operatorname{Sch}_X$ which we again denote by abuse of notation as $$F_U\colon \operatorname{Sch}^{op}_X\to \operatorname{Set}.$$
Observation 4-
There is an adujunction morphism $\eta\colon \mathcal{B}\to j_*j^{*}\mathcal{B}=j_*\mathcal{B}|_U.$ On an open set $V\subset X$, the morphism is the restriction morphism from $\eta_V\colon \Gamma(V,\mathcal{B})\to \Gamma(U\cap V,\mathcal{B})$. This is a morphism of algebras since $\mathcal{B}$ is a sheaf of algebras.
In particular, for any $\mathcal{O}_U$ algebra $\mathcal{A}$, and a morphism of $\varphi \colon \mathcal{B}|_U\to \mathcal{A}$ of $\mathcal{O}_U$ algebras, the composition
$$\mathcal{B}\xrightarrow{\eta} j_*\mathcal{B}|_U\xrightarrow{j_*\varphi}j_*\mathcal{A}$$ is a morphism of $\mathcal{O}_X$-algebras, and so you get an induced morphism
$$\eta^*\colon\operatorname{Hom}_{\mathcal{O}_X-\text{Alg}}(j_*\mathcal{B}|_U,j_*\mathcal{A} )\to \operatorname{Hom}_{\mathcal{O}_X-\text{Alg}}(\mathcal{B},j_*\mathcal{A})$$ by pre-composition. Note that this is functorial in $\mathcal{A}$ i.e. $\eta^*$ is a natural transformation between two functors in the variable $\mathcal{A}$.
But note that any $\mathcal{O}_X$-algebra morphism $j_*\mathcal{B}|_U\to j_*\mathcal{A}$ is just an $\mathcal{O}_U$-algebra morphism since $j\colon U\hookrightarrow X$ is an open embedding. So in fact the morphism we get is
$$\eta^*\colon \operatorname{Hom}_{\mathcal{O}_U-\text{Alg}}(\mathcal{B}|_U,\mathcal{A} )\to \operatorname{Hom}_{\mathcal{O}_X-\text{Alg}}(\mathcal{B},j_*\mathcal{A}).$$
Observation 5- Note that the morphism $\eta^*$ is a monomorphism of functors.
Indeed suppose $\alpha,\beta\colon \mathcal{B}|_U\to \mathcal{A}$ are morphisms of $\mathcal{O}_U$-algebras which satisfy $\alpha\circ \eta=\beta\circ \eta$, then in particular at stalks for all $x\in U$ they must satisfy $\alpha_x=\beta_x$ and so $\alpha=\beta$.
Thus we see that $\eta^*$ as defined in Observation $4$ is a monomorphism.
Observation 6- Now using the definition of $F_U$ in Observation $3$ and $F$ as in Objective, we get a monomorphism of functors $$\eta^*\colon F_U\to F.$$
Indeed for any scheme $f\colon T\to X$, we have two conditions. Either $f$ factors through $U$ or it doesn't. In case it does, then what we discussed above shows that $\eta^*_T\colon F_U(T)\to F(T)$ is an injection. In case it doesn't, then $F_U(T)$ is $\emptyset$ and so tautologically a subfunctor of $F(T)$.
Observation 7- Let $g\colon S\to X$ be any $X$-scheme. An $S$-valued point of $F$ is an object of $F(S)=\operatorname{Hom}_{\mathcal{O}_X-\text{Alg}}(\mathcal{B},g_*\mathcal{O}_S)$ i.e. a morphism $\varphi\colon \mathcal{B}\to g_*\mathcal{O}_S$. By Yoneda this is the data of a morphism $\varphi^*\colon h_S\to F$.
So we get a morphism of functors $\eta^*\colon F_U\to F$ and $\varphi^*\colon h_S\to F$ whose fiber product is $F_U\times_F h_S$ in the category of presheaves on $\operatorname{Sch}_X$.
Observation 8- Since limits can be computed pointwise, let $f\colon T\to X$ be an object of $\operatorname{Sch}_X$ and so $$F_U\times_F h_S(T)=F_U(T)\times_{F(T)}h_S(T).$$
Assuming $F_U(T)\neq \emptyset$, the object on the right consists of pairs $(\alpha, h)$ where $\alpha\colon \mathcal{B}|_U\to f_*\mathcal{O}_T$ and $h\colon T\to S$ an $X$ morphism (i.e. $g\circ h=f$). These pairs have to satisfy the condition that they agree over $F(T)$ i.e. they define the same $T$ point of $F$ via the natural maps $\varphi^*\colon h_S\to F$ and $\eta^*\colon F_U\to F$.
More explicitly, this is the condition that the composition $\mathcal{B}\xrightarrow{\varphi} g_*\mathcal{O}_S\xrightarrow{F(h)}f_*\mathcal{O}_T$ agrees with the composition $\mathcal{B}\xrightarrow{\eta}\mathcal{B}|_U\xrightarrow{\alpha}f_*\mathcal{O}_T.$
Observation 9- We need to show now that the functor $F_U\times_F h_S$ is representable by an open subscheme of $S$.
It is enough to consider the open subscheme $V\hookrightarrow S$ so that $h\colon T\to S$ factors as $T\to V\hookrightarrow S$ if and only if $f\colon T\to X$ factors as $T\to U\hookrightarrow X$. Explicitly this subscheme is the preimage $V\colon=g^{-1}U$ where $g\colon S\to X$ was the structure morphism.
Indeed any $T$ point of $h_V$ i.e. a morphism $f  \colon T\to V$ would define a $T$ point of $h_S$ by composition with the open immersion $V\hookrightarrow S$. Moreover, it defines a $T$ point of $F_U$ by definition of $V$. I leave it as an exercise in unwinding definitions to check that these $T$-points agree on $F(T)$.
Thus the pullback is representable by $V$ as defined above.
Observation 10- If $\bigcup_i U_i$ is a Zariski cover of $X$ by affine opens, then for each $i$ the functor $$F_i(-) \colon=\operatorname{Hom}_{\mathcal{O}_{U_i}-\text{Alg}}(\mathcal{B}|_{U_i}, )$$ satisfies the conditions above.
The $V_i\colon= g^{-1}U_i$ constructed as above cover $S$ for each $X$-scheme $g\colon S\to X$. Thus these functors form a Zariski open covering of the functor $F$ defined as in Objective.
