I have read in several texts that in order to show that a given functor from the category of schemes (over, say an algebraically closed field $k$) to $\mathsf{Set}$ is representable, it suffices to check that it is representable in the subcategory of affine schemes. How is this the case? I have not been able to find a proof of this fact, and it may be rather trivial, but I do not see the connection.



Criteria for representability of a functor from schemes to sets
The statement



> 
> to show that a given functor [$F\colon \mathsf{Sch}^{\mathit{op}}\to\mathsf{Set}$] is representable, it suffices
>  to check that it is representable in the subcategory of affine schemes
> 
> 
> 


isn't exactly true: for example, if $X$ is a scheme that's not affine, $\mathrm{Hom}(-, X)$ is representable in
$\mathsf{Sch}$, but not in the subcategory $\mathsf{AffSch}$ of affine schemes.


What is true, though, is that any representable functor is determined (up to natural isomorphism) by its
restriction to $\mathsf{AffSch}$. This is because, for any schemes $X$ and $Y$, $U\mapsto \mathrm{Hom}(U,X)$ (for
$U\subset Y$ open) is a sheaf on $Y$ in the Zariski topology, and every scheme $Y$ admits an affine open cover.
Hence we can determine $\mathrm{Hom}(Y, X)$ from the collection of $\mathrm{Hom}(U, X)$ as $U$ ranges over the
affine open subschemes of $Y$.


This leads to the statement that you might have seen: if you're defining a scheme by first defining a functor
$F\colon\mathsf{Sch}^{\mathit{op}}\to\mathsf{Set}$, then checking that $F$ is representable, you actually only need
to define $F$ on affine schemes. This is particularly useful for defining group schemes, e.g. defining
$\mathrm{GL}\_n$ by checking that the functor $\mathrm{Spec} R\mapsto \mathrm{GL}\_n(R)$ is representable.


(Note: I might have misinterpreted you when you wrote “it suffices to check that it is representable in the
subcategory of affine schemes” – if you didn't mean the incorrect statement, then sorry about that!)


