Let $J$ be a filtered category and $\mathcal J$ a functor $\mathcal J:J\to Grp$; let $G: Grp\to Set$ be the forgetful functor and $\lambda :G\circ \mathcal J\overset{\cdot }\rightarrow d$ be a colimit cone in $Set$. The exercise is to use the properties of $J$ to place a group structure on $d$ such that $\lambda $ has components that are group homomorphisms.
Can you check the proof? Here is what I did:
$1).\ $The UMP of the colimit assures that for each $p\in d\ \exists j\in J, g_{j}\in G_{j}$ such that $\lambda _{j}g_{j}=p$.
$2).\ $ Let $e_i$ be the unit in $G_i$. Since $G_{ij}:G_i\to G_j$ are group homomorphisms, $G_{ij}e_i=e_j$ and so if $e_i\in G_i$ and $e_j\in G_j$ then since $J$ is filtered there is an $m\in J$ such that $\lambda _{m}G_{im}=\lambda _{i}$ and $\lambda_{m}G_{km}=\lambda _{k}$ which shows that $\lambda _{i}e_i=\lambda _ke_k$ and so we set this common element in $d$ to be the unit $e$.
$3).\ $Let $p,q\in S$ and choose $g_{j}, g_{k}$ such that $\lambda g_{j}=p;\ \lambda g_{k}=q$. Since $J$ is filtered, $\exists n\in J$ and arrows $G_{jn}:G_j\to G_n;\ G_{kn}:G_k\to G_n$ and so we define $p*q\equiv \lambda _n(G_{jn}(g_{j})G_{kn}(g_{k}))$. Since the $G_{lm}$ are group homomorphisms, this product is independent of the choice of $n\in J$. Using $(2)$ this means that each $p\in S$ has an inverse, namely $\lambda _jg_j^{-1}$.
$4). \ $These considerations turn $d$ into a group, as is easily checked. Now let $\lambda _i :G_i\to S$ and $g,g'\in G_i$. By the remark in $(3)$, the multiplication is independent of the choice of $n\in J$ so with $r=\lambda _{i}g$ and $s=\lambda _{i}g'$ we have $r*s=\lambda _{i}g*\lambda _{i}g'=\lambda _i(gg'))$ by definition.
Combine $(1)$ - $(4)$ and the claim follows.