Is it always possible to write a scheme as a colimit of affine schemes?

Yes, this is just a basic fact in category theory, if interpreted correctly. For $C$ any category, and $F$ any preheaf on $C,$ $F$ is the colimit in presheaves of the diagram $C/F \to C \stackrel{y}{\hookrightarrow} Psh(C),$ which sends a morphism $f:y(C) \to F,$ to $y(C),$ where $y$ is the Yoneda embedding. This follows immediately from the Yoneda lemma. Now, if $F$ is a sheaf for some Grothendiek topology, then since the sheafification functor $a$ is a left adjoint, it preserves all colimits, so we also have that $F$ is the colimit of the diagram $C/F \to C \stackrel{y}{\hookrightarrow} Sh(C).$ Note that this diagram consists entirely of representables (provided the Grothendieck topology is subcanonical, i.e. each representable is a sheaf). Now, take $C$ to the the category of affine schemes, and let the Grothendieck topology be the Zariski topology. The functor of points of any scheme, in particular, is a sheaf. The result now follows.


Yes. Let's assume your scheme $X$ has affine diagonal. This implies that, if $U_i$ is an affine open cover, then $U_{ij}$ is also an affine open cover. Then $X$ is the co-equalizer you wrote.

However, if $X$ does not have affine diagonal, it's more annoying. The problem is that the $U_{ij}$ will not be affine and you need to cover them further. So, start with an open affine cover $U_i$, then pick an affine open cover $V_k^{ij}$ of each intersection $U_{ij}$. Then pick an affine open cover of each triple intersection $V^{ij}_k \cap V^{ab}_h$... so on and so forth. You get a big Cech-type diagram and its colimit will still be $X$. (the buzzword here is "hypercover")


Actually, every scheme is the canonical colimit of all affine schemes mapping into it: $$X = \underset{\substack{U \to X\\U \text{ affine}}}{\mathrm{colim}} U$$ In order to avoid size issues, we can in fact restrict ourselves to open affine subschemes $U \hookrightarrow X$ here. (So the diagram scheme doesn't really depend on the choice of an open affine cover of $X$. But the proof, that $X$ is the colimit, clearly requires such a choice.)

The statement above is equivalent to the statement that the functor of points $\mathsf{Sch} \to [\mathsf{CRing},\mathsf{Set}]$ is fully faithful. In functorial algebraic geometry, one defines $\mathsf{Sch}$ as a certain full subcategory of $[\mathsf{CRing},\mathsf{Set}]$, so in that setting there would be nothing to prove.