Solution (source code)

= Solution

The equations $pi=1_A$ give $(ip)i=i$, so $i$ equalizes $ip$ and $1_B$. If $h:X\to B$ satisfies $(ip)h=h$, put $k=ph:X\to A$. Then $ik=iph=h$. If $k'$ is another such factorization, applying $p$ gives $k'=pik'=ph=k$. This proves
$$
\boxed{i:A\to B\text{ is the equaliser of }ip\text{ and }1_B.}
$$
In particular the inclusion in a <retract in a category> is a <monomorphism>.