Solution (source code)

= Solution

For $X:\mathcal C^{\mathrm{op}}\to\mathbf{Set}$, let $\int X$ be its <category of elements>. Its objects are $(A,a)$ with $a\in X(A)$; an arrow $(A,a)\to(B,b)$ is a <morphism> $f:A\to B$ satisfying $X(f)b=a$. This is a <small category>, because $\mathcal C$ is small and all values of $X$ are <sets>.

Send $(A,a)$ to the <representable presheaf> $h_A$, and send an arrow $f$ to postcomposition $h_f$. There is a <cocone> to $X$ whose map at $(A,a)$ is
$$
\iota_{A,a}:h_A\to X,\qquad
(\iota_{A,a})_C(g)=X(g)a.
$$
The <functor> laws give its <naturality> and the required <cocone> compatibility.

Compute the <colimit> pointwise as a disjoint union modulo its diagram identifications. At $C$ a representative is a triple $(A,a,g:C\to A)$, and it maps to $X(g)a\in X(C)$. Every $x\in X(C)$ is the image of $(C,x,1_C)$. Moreover $g$ is an arrow $(C,X(g)a)\to(A,a)$ in $\int X$, so its diagram relation identifies
$$
(A,a,g)\sim(C,X(g)a,1_C).
$$
Thus every representative is identified with the canonical representative of its image. Two representatives have equal images exactly when their canonical representatives agree. This proves a componentwise <bijection>; restriction maps respect it. The resulting <natural isomorphism> is the <canonical colimit presentation of a presheaf>:
$$
\boxed{X\cong\operatorname{colim}_{(A,a)\in\int X}h_A.}
$$