This is Exercise 1.3.N from Vakil's notes of Algebraic Geometry. The following is the diagram defining the universal property of fibred product:

Show that in $\mathit{Sets}$, $$X\times_Z Y=\{(x,y)\in X\times Y: \alpha(x)=\beta(y)\}.$$
My attempt:
Let $W$ be a set. Suppose there exist maps $\phi: W\rightarrow X$ and $\psi: W\rightarrow Y$, such that $\alpha\circ \phi=\beta\circ \psi$. We prove that there exists a unique map $\sigma: W\rightarrow X\times_Z Y$ such that $\beta\circ\text{Pr}_Y\circ \sigma=\beta\circ\psi$ and $\alpha\circ\text{Pr}_X\circ \sigma=\alpha\circ \phi$.
Obviously we can define $\sigma(w)=(\phi(w),\psi(w))$ and prove that it is well-defined and satisfies the equality.
My question:
I am stuck at the proof of uniqueness. Suppose another map $\tau(w)=(\tau_X(w), \tau_Y(w))$ also satisfies $$\beta\circ\text{Pr}_Y\circ \tau=\beta\psi,\\ \alpha\circ\text{Pr}_X\circ\tau=\alpha\phi.$$
So I end up with $$\beta\circ\tau_Y=\beta\circ \psi,\\ \alpha\circ\tau_X=\alpha\circ \phi.$$
But these do not necessarily imply $\tau_Y=\psi$ and $\tau_X=\phi$, which is what I want to show. Since the maps are all through $\alpha$ and $\beta$, there seems no way to get rid of them. How to proceed?
Thank you for your help!
We have $\Pr_X \circ~ \tau = \phi$ and $\Pr_Y \circ~ \tau = \psi$. So $\tau_X = \phi$ and $\tau_Y = \psi$.
Hence $\tau = (\tau_X, \tau_Y) = (\phi, \psi) = \sigma$.