How do I prove that $X$ is the pullback of this cospan? Say we have a category $C$ with products and pullbacks.  Let $X$ be an object of $C$.  There's a canonical comonoid with multiplication $\Delta\colon X \to X\times X$, and it satisfies the coassociativity law, which is a commuting square.  If I take the cospan at the bottom of that square, 
$$X\times X \stackrel{X \times \Delta}{\to} X\times X\times X \stackrel{\Delta \times X}{\leftarrow} X\times X$$
how do I prove that $X$ is the pullback of the cospan (up to isomorphism, of course)?  It's obvious how to prove it for $C = \mbox{Set},$ but I'm having trouble figuring out how to do it for the general case.  I'm sure I'm just missing something trivial that will be obvious in retrospect.
Suppose the pullback is $P$ with morphisms $\pi_1, \pi_2\colon P \to X\times X$.  Then by the universal property of the pullback, there's a unique morphism $q\colon X \to P$ such that $\pi_1 \circ q = \Delta$ and $\pi_2 \circ q = \Delta$.
This $q$ should be the inverse of $\pi_1 \circ \pi_1\colon P \to X$.  We have
$$\begin{array}{rl}&X \stackrel{q}{\to} P \stackrel{\pi_1}{\to} X\times X \stackrel{\pi_1}{\to} X\\ =& X \stackrel{\Delta}{\to} X\times X \stackrel{\pi_1}{\to} X \\ =& X \stackrel{X}{\to} X\end{array}$$
so $q$ is at least a one-sided inverse to $\pi_1 \circ \pi_1$.
I suspect that showing the next part has something to do with the uniqueness of $q$ and the uniqueness of the identity on $P$ as the morphism given by the universal property when taking $P$ itself as the competitor, but I can't quite get it.

In fact, the case $\mathcal{C} = \mathbf{Set}$ suffices, because the Yoneda embedding is fully faithful and preserves limits. But here's a direct proof. We wish to show that the diagram
$$\require{AMScd}
\begin{CD}
X @>{\Delta}>> X \times X \\
@V{\Delta}VV @VV{\Delta \times \mathrm{id}_X}V \\
X \times X @>>{\mathrm{id}_X \times \Delta}> X \times X \times X
\end{CD}$$
is a pullback square. Let $T$ be any object and consider morphisms $f, g : T \to X \times X$ such that $(\mathrm{id}_X \times \Delta) \circ f = (\Delta \times \mathrm{id}_X) \circ g$. Applying the projections, this says $\pi_1 \circ f = \pi_1 \circ g$, $\pi_2 \circ f = \pi_1 \circ g$, and $\pi_2 \circ f = \pi_2 \circ g$. But that means there is a unique morphism $h : T \to X$ such that $f = \Delta \circ h$ and $g = \Delta \circ h$, as required.
