Image of the diagonal map in a scheme and the set on which the projections agree Let $f:X\to Y$ be a morphism of schemes, let $z\in X\times_Y X$ such that
(1) $p_1(z)=p_2(z)$;
(2) let $x = p_1(z) = p_2(z)$, then $(p^\#_1)z:\mathcal{O}_{X,x}\to \mathcal{O}_{X\times_Y X,z}$ is equal to $(p^\#_2)z:\mathcal{O}_{X,x}→\mathcal{O}_{X\times_Y X,z}$. 
How can I prove that $z \in \Delta(X)$?
 A: Let $C$ be a scheme. Suppose $A$ and $B$ are schemes over $C$ and we have two $C$-morphism $f_1$, $f_2:A\rightarrow B$. It can be shown that there exists a morphism of $C$-schemes $i:A_{f_1=f_2}\rightarrow A$ such that for any morphism $g:D\rightarrow A$ such that $f_1\circ g=f_2\circ g$, there exists a unique morphism $j:D\rightarrow A_{f_1=f_2}$ such that $g=i\circ j$. See Section 10.2.A of November 2017 version of Vakil's textbook for this. 
Now take $A=X\times_Y X$, $B=X$, $C=Y$, $f_1=pr_1$, $f_2=pr_2$. Remark 10.2.1 (iii) of Vakil's textbook implies that for any point $p$ of $X\times_Y X$ satisfying your two properties, the inclusion $p\rightarrow X\times_Y X$ factors through $(X\times_Y X)_{pr_1=pr_2}\rightarrow X\times_Y X$ (this may also be helpful). 
If we prove that the diagonal morphism satisfies the universal property in the first paragraph, it is game over. 
So suppose we have a map $g:D\rightarrow X\times_Y X$ such that $pr_1\circ g=pr_2\circ g$. Since $pr_1\circ g=pr_2\circ g$, we have a commutative diagram 
$\require{AMScd}$
\begin{CD}
    D @>pr_1\circ g>> X\\
    @V pr_2\circ g V V @VV f V\\
    X @>>f> Y.
\end{CD}
We also have a possibly noncommutative diagram
$\require{AMScd}$
\begin{CD}
    D @>pr_1\circ \Delta \circ pr_1\circ g>> X\\
    @V pr_2 \circ \Delta \circ pr_2\circ g V V @VV f V\\
    X @>>f> Y.
\end{CD}
By the definition of $\Delta$, these two diagrams are the same. The universal property of the fiber product then implies that $g=\Delta \circ (pr_1 \circ g)$. This proves the existence part of the universal property in the first paragraph. 
To prove the uniqueness part, note that $\Delta$ is a monomorphism so if a factorization $g=\Delta \circ g'$ exists, it is unique. Game over. 
