Consider the following diagram of algebraic varieties:


$$\mathbb{A}^0 \to \mathbb{A}^1 \rightrightarrows \mathbb{A}^2$$


Here the first arrow is the inclusion of the origin into the line, and the next two are the inclusion of the line into the plane as the X and the Y axes.



> 
> Does this diagram have a colimit in the category of schemes?
> 
> 
> 


(The first arrow giving inclusion of the point is not relevant; it just so happens that it was there when I met this question.)



Can I glue the X axis to the Y axis?
We can rewrite the coequalizer as the pushout of the diagram
$$
\begin{array}{ccc}
 X & \to & \mathbb A^2 \\
 \downarrow & & \\
 \mathbb A^1 & & \\
\end{array}
$$
where $X$ is the union of the $x$- and $y$-axis, and the vertical map quotients by the involution swapping the two components.


The category of affine schemes has all pushouts: they are given by fibered product of coordinate rings. But a pushout in the category of affine schemes is not necessarily a pushout in the category of all schemes. A sufficient condition for a pushout of affine schemes to be a pushout in the category of schemes can be found in a paper of Karl Schwede ("Gluing schemes and a scheme without closed points", Theorem 3.4): it suffices that one leg of the pushout is a closed immersion. So we are fine.


As noted by Gro-Tsen in a comment, the pushout can be written explicitly as $\mathrm{Spec}(R)$ where $R = \{ f \in k[x,y] : f(t,0)=f(0,t)\}$.


