# If the equalizer of two scheme morphisms is surjective, does that mean the two morphisms are the same?

Let $$Z$$ be a scheme, and $$f , g : X \rightarrow Y$$ be two morphisms of schemes over $$Z$$. Suppose the continuous function of $$i : eq(f,g) \rightarrow X$$ is surjective. Does this imply that $$f = g$$?

My guess is no, because the functor sending a scheme to its underlying set of points is very badly behaved, and scheme morphisms are not determined completely by their underlying continuous function.

My idea for a counter-example is that: if the underlying continuous function $$eq(f, g)$$ had the same topological space as $$X$$ but different structure sheaves, then the map $$eq(f, g) \rightarrow X$$ is not the identity but is surjective.

One way to get $$eq(f, g)$$ and $$X$$ having the same underlying space is to have $$X = Spec(A)$$ be affine, and $$eq(f, g) \rightarrow X$$ being the map $$A \rightarrow A / nil(A)$$. However, that would mean I have to construct it as a coequalizer, and I don't know how to do that. Furthermore, I'm not sure if the equalizer in the category of affine schemes is the same as the equalizer in the category of all schemes.

First, note that the functor $$\operatorname{Spec}:\mathtt{CRing}^{op}\to\mathtt{Sch}$$ has a left adjoint, namely the functor that sends a scheme to its ring of global functions (proof: a morphism $$X\to\operatorname{Spec} A$$ is equivalent to a compatible family of homomorphisms $$A\to B$$ for each affine open $$\operatorname{Spec} B$$ in $$X$$, which by gluing is equivalent to a homomorphism $$A\to\mathcal{O}_X(X)$$). Thus $$\operatorname{Spec}$$ preserves limits, and in particular we can compute equalizers of affine schemes by just taking coequalizers of rings.

Now for an example. Let $$k$$ be a field, let $$A=k[x]/(x^2)$$, and let $$f^*,g^*:A\to A$$ be the identity map and the map that sends $$x$$ to $$0$$, respectively. Letting $$X=\operatorname{Spec} A$$, these induce morphisms $$f,g:X\to X$$. The coequalizer of $$f^*$$ and $$g^*$$ is just the obvious quotient map $$k[x]/(x^2)\to k$$ and so the equalizer of $$f$$ and $$g$$ is the corresponding map $$i:\operatorname{Spec} k\to X$$. This map $$i$$ is surjective, but $$f\neq g$$.