I'm happy you didn't manage to prove your statement because it is false!
Here is a counter-example:
Take $X=Y=Spec (\mathbb C)=\{\omega\}$ and $S=Spec(\mathbb R)$, so that $Y\times_SY=Spec(\mathbb C\otimes_\mathbb R \mathbb C)$.
And take for $f,g$ the morphisms $X\to Y$ corresponding to the identity and the conjugation $\mathbb C\to \mathbb C$.
Then the morphism $h:X\to Y\times_SY$ corresponds to the $\mathbb R$-algebra morphism $\mathbb C\otimes_\mathbb R \mathbb C\to \mathbb C:z\otimes w\mapsto z\bar w $ .
Hence the image $h(\omega)$ of $h:X \to Y\times_{S} Y$ is the point corresponding to the prime ideal $\mathfrak p\subset \mathbb C\otimes_\mathbb R \mathbb C$ equal to the real vector space generated by the two vectors $1\otimes 1-i\otimes i,i\otimes 1+1\otimes i\in \mathbb C\otimes_\mathbb R \mathbb C$ i.e. $$ \mathfrak p=\mathbb C(1\otimes 1-i\otimes i)\oplus \mathbb C(i\otimes 1+1\otimes i) \in Spec(\mathbb C\otimes_\mathbb R \mathbb C) $$
Whereas the morphism $\Delta :Y\to Y\times_SY$ corresponds to the $\mathbb R$-algebra morphism $\mathbb C\otimes_\mathbb R \mathbb C\to \mathbb C:z\otimes w\mapsto zw $ .
Hence the image $\Delta (\omega)$ of the diagonal morphism corresponds to the prime ideal $\mathfrak q\subset \mathbb C\otimes_\mathbb R \mathbb C$ equal to the real vector space generated by the two vectors $1\otimes 1+i\otimes i , i\otimes 1-\otimes i \in \mathbb C\otimes_\mathbb R \mathbb C$ i.e. $$ \mathfrak q=\mathbb C(1\otimes 1+i\otimes i)\oplus \mathbb C(i\otimes 1-1\otimes i) \in Spec(\mathbb C\otimes_\mathbb R \mathbb C) $$
Conclusion:
The unique point $\omega$ of $X$ has an image not contained in the diagonal of the product:
$$ \omega \in X \;\text {satisfies}\; f(\omega)=g(\omega)\in Y \; \text {but} \;h(\omega)= \mathfrak p \notin Im(\Delta)=\{\Delta (\omega)\}=\{\mathfrak q\} $$