Suppose that $X$ is a scheme over $Y$. Let $f:U \to X \times_{Y}X$ be a morphism such that $p_1 \circ f = p_2 \circ f$ where $p_1, p_2$ are projections maps from $X \times_{Y} X \to X$.
Show that $f$ factors through the diagonal morphism $\Delta: X \to X\times _{Y}X $.
Let $g = p_1 f : U \to X$. I claim that $f = \Delta g$. Since both are morphisms to $X \times_Y X$, it suffices to check this after composing with the projections. But we have $p_1 f = g = p_1 \Delta g$ and $p_2 f = p_1 f = g = p_2 \Delta g$.
PS: This has nothing to do with schemes, it holds in any category with products (here we apply this to the category of $Y$-schemes). Basically we have seen that $\Delta : X \to X \times X$ is the equalizer of the two projections. More generally, in any category, every split monomorphism is regular.