TITLE: Fibered products in $\mathsf {Set}$
QUESTION [5 upvotes]: I'm just starting to work through Aluffi, and one question asks the reader to define fibered products (and coproducts) in the category of sets and functions. I'm just looking to check that I have the fibered products right before I move on to the fibered coproducts.
Let $\alpha\colon A\to C$ and let $\beta\colon B\to C$. Then the fibered product of $\alpha$ and $\beta$ is (I think), the set product $P:=\alpha^{-1}[\beta[B]]\times\beta^{-1}[\alpha[A]]$ together with the usual projections $\pi_A$ and $\pi_B$.
Proof (I hope):
Let $f\colon Z\to A$ and $g\colon Z\to B$ so that $\alpha f=\beta g$. Suppose that for some $\sigma\colon Z\to P$, $f=\pi_A \sigma$ and $g=\pi_B \sigma$. Then for each $z\in Z$, $\pi_A(\sigma(z))=f(z)$ and $\pi_B(\sigma(z))=g(z)$, so for all $z\in Z$, $\sigma(z)=(f(z),g(z))$ (so $\sigma$ is unique).
Indeed, this assignment works: if $z\in Z$, then $\alpha(f(z))=\beta(g(z))\in \beta[B]$, so surely $f(z)\in \alpha^{-1}[\beta[B]]$, and symmetrically a similar thing holds for $g$, so $(f(z),g(z))\in P$. That $\pi_A\sigma=f$ and $\pi_B\sigma=g$ is then immediate.
Update
As the answers indicate, that was wrong. Can someone tell me if the answer I give below is correct?

REPLY [6 votes]: Responding to Keenan Kidwell's helpful criticism and Ma Ming's perhaps-overly-generous hint, I try again:
Let $P=\{(a,b):\alpha(a)=\beta(b)\}$ and again use the canonical projections. Define $\sigma$ the same way (again, there is no other choice). Now if $z\in Z$, then $\alpha(f(z))=\beta(g(z))$, so $(f(z),g(z))\in P$ and everything works out as it should.