[proofplan]
We use the [presentation description of the free product](/theorems/???): if $G_1 = \langle S_1 \mid R_1 \rangle$ and $G_2 = \langle S_2 \mid R_2 \rangle$, then $G_1 * G_2 = \langle S_1 \sqcup S_2 \mid R_1 \cup R_2 \rangle$. The universal property of $G_1 * G_2$ is then a direct consequence of the [universal property of group presentations](/theorems/???): any set map from $S_1 \sqcup S_2$ into a group $K$ that kills all relations extends uniquely to a homomorphism from the presentation. We construct the required set map from the given $\phi_1, \phi_2$ on generators, verify that every relation of $R_1 \cup R_2$ is killed by hypothesis (each $\phi_i$ is itself a homomorphism), and then check that the resulting homomorphism $f$ restricted to the canonical inclusion $j_i$ recovers $\phi_i$. Uniqueness follows from the uniqueness half of the presentation universal property.
[/proofplan]
[step:Fix presentations of $G_1$ and $G_2$]
Choose presentations $G_i = \langle S_i \mid R_i \rangle$ for $i = 1, 2$ with $S_1 \cap S_2 = \varnothing$ (renaming if necessary). Write $\pi_i: F(S_i) \to G_i$ for the quotient map, so that
\begin{align*}
G_i \cong F(S_i) / N_i,
\end{align*}
where $N_i = \langle\!\langle R_i \rangle\!\rangle$ is the normal closure of $R_i$ in $F(S_i)$ (here each $r \in R_i$ is a word in $S_i \cup S_i^{-1}$, viewed as an element of $F(S_i)$).
By the [presentation description of the free product](/theorems/???),
\begin{align*}
G_1 * G_2 \cong \langle S_1 \sqcup S_2 \mid R_1 \cup R_2 \rangle = F(S_1 \sqcup S_2) / N,
\end{align*}
where $N := \langle\!\langle R_1 \cup R_2 \rangle\!\rangle$ is the normal closure in $F(S_1 \sqcup S_2)$. Let $\pi: F(S_1 \sqcup S_2) \to G_1 * G_2$ be the quotient map. The canonical inclusions $j_i: G_i \to G_1 * G_2$ are characterised by sending a generator $s \in S_i$ (viewed as an element of $G_i$ via $\pi_i$) to its image $\pi(s) \in G_1 * G_2$ (viewed as an element of the free product via $\pi$). In particular, for $s \in S_i$,
\begin{align*}
j_i(\pi_i(s)) = \pi(s).
\end{align*}
[guided]
The free product $G_1 * G_2$ is defined (up to isomorphism) by the presentation $\langle S_1 \sqcup S_2 \mid R_1 \cup R_2 \rangle$: take the free group on the disjoint union of generators and quotient by all relations from both groups. The inclusions $j_i$ are the maps that send a generator $s \in S_i$ of $G_i$ to the "same" generator $s \in S_1 \sqcup S_2$ of the free product.
We need $S_1 \cap S_2 = \varnothing$ so that we can unambiguously talk about elements of $S_1 \sqcup S_2$; if the generating sets overlap, we rename to remove the overlap (the resulting presentation still defines the same groups up to isomorphism).
[/guided]
[/step]
[step:Define a candidate set map $S_1 \sqcup S_2 \to K$ from $\phi_1, \phi_2$]
Define the set map
\begin{align*}
\psi: S_1 \sqcup S_2 &\to K, & \psi(s) &:= \begin{cases} \phi_1(\pi_1(s)) & \text{if } s \in S_1, \\ \phi_2(\pi_2(s)) & \text{if } s \in S_2. \end{cases}
\end{align*}
The disjointness $S_1 \cap S_2 = \varnothing$ ensures $\psi$ is well-defined.
By the [universal property of the free group](/theorems/1900) applied to $\psi: S_1 \sqcup S_2 \to K$, there is a unique homomorphism
\begin{align*}
\tilde{f}: F(S_1 \sqcup S_2) \to K
\end{align*}
such that $\tilde{f}(s) = \psi(s)$ for all $s \in S_1 \sqcup S_2$.
[/step]
[step:Verify that $\tilde{f}$ kills every relation in $R_1 \cup R_2$]
Let $r \in R_1$, written as a reduced word $r = x_1 x_2 \cdots x_n$ in $S_1 \cup S_1^{-1} \subseteq F(S_1)$. Under the inclusion $F(S_1) \hookrightarrow F(S_1 \sqcup S_2)$ (which is an inclusion of free groups because $S_1 \subseteq S_1 \sqcup S_2$), the element $r$ is represented by the same word in $F(S_1 \sqcup S_2)$.
Since $\tilde{f}$ is a homomorphism,
\begin{align*}
\tilde{f}(r) = \tilde{f}(x_1) \tilde{f}(x_2) \cdots \tilde{f}(x_n),
\end{align*}
where $\tilde{f}(x_j) = \psi(x_j) = \phi_1(\pi_1(x_j))$ if $x_j \in S_1$ and $\tilde{f}(x_j^{-1}) = \tilde{f}(x_j)^{-1} = \phi_1(\pi_1(x_j))^{-1} = \phi_1(\pi_1(x_j)^{-1})$. In either case, $\tilde{f}(x_j) = \phi_1(\pi_1(x_j))$ using that $\phi_1$ is a homomorphism. Therefore
\begin{align*}
\tilde{f}(r) = \phi_1(\pi_1(x_1)) \phi_1(\pi_1(x_2)) \cdots \phi_1(\pi_1(x_n)) = \phi_1\bigl(\pi_1(x_1) \cdots \pi_1(x_n)\bigr) = \phi_1(\pi_1(r)).
\end{align*}
Since $r \in R_1 \subseteq N_1$ and $\pi_1: F(S_1) \to G_1$ has kernel $N_1$, we have $\pi_1(r) = e_{G_1}$, and so $\tilde{f}(r) = \phi_1(e_{G_1}) = e_K$.
Symmetrically $\tilde{f}(r) = e_K$ for every $r \in R_2$. Hence $\tilde{f}$ vanishes on $R_1 \cup R_2$, and since the kernel of a homomorphism is a normal subgroup, $\tilde{f}$ also vanishes on the normal closure $N = \langle\!\langle R_1 \cup R_2 \rangle\!\rangle$.
[guided]
The strategy is to reduce the verification of the relations to the fact that $\phi_i$ is already a homomorphism on $G_i$. For $r \in R_1$, the element $\tilde f(r) \in K$ is the image under $\phi_1$ of $\pi_1(r) \in G_1$; since $r$ is a relation, $\pi_1(r) = e_{G_1}$, and homomorphisms send the identity to the identity. So $\tilde f(r) = e_K$ for free — no new constraint is imposed beyond what $\phi_1$ already satisfies.
Why does $\tilde f$ also vanish on the full normal closure $N$ of $R_1 \cup R_2$? Because the kernel $\ker \tilde f$ is a normal subgroup of $F(S_1 \sqcup S_2)$ containing $R_1 \cup R_2$, and $N$ is the smallest such subgroup. Hence $N \subseteq \ker \tilde f$.
[/guided]
[/step]
[step:Descend to a homomorphism $f: G_1 * G_2 \to K$ and verify the universal property]
Since $\tilde{f}$ vanishes on $N$, it factors uniquely through the quotient $\pi: F(S_1 \sqcup S_2) \to F(S_1 \sqcup S_2)/N = G_1 * G_2$ by the [first isomorphism theorem / universal property of the quotient group](/theorems/???):
\begin{align*}
f: G_1 * G_2 &\to K, & f \circ \pi &= \tilde{f}.
\end{align*}
Concretely, $f(\pi(w)) = \tilde{f}(w)$ for every $w \in F(S_1 \sqcup S_2)$.
We verify $\phi_i = f \circ j_i$ for $i = 1, 2$. By the presentation description of $j_i$ (Step 1), for $s \in S_i$,
\begin{align*}
(f \circ j_i)(\pi_i(s)) = f(j_i(\pi_i(s))) = f(\pi(s)) = \tilde{f}(s) = \psi(s) = \phi_i(\pi_i(s)).
\end{align*}
Since both $f \circ j_i$ and $\phi_i$ are homomorphisms from $G_i$ to $K$ agreeing on the generators $\{\pi_i(s) : s \in S_i\}$, and $G_i$ is generated by these elements, we conclude $f \circ j_i = \phi_i$.
[guided]
At the level of the presentation: we have a homomorphism $\tilde f$ out of the free group $F(S_1 \sqcup S_2)$, and it kills all the relations $R_1 \cup R_2$ (hence the normal closure $N$). So $\tilde f$ descends to a homomorphism $f$ out of the quotient $F(S_1 \sqcup S_2)/N = G_1 * G_2$.
The compatibility $f \circ j_i = \phi_i$ is checked on generators: on a generator $\pi_i(s) \in G_i$ (for $s \in S_i$), we have $j_i(\pi_i(s)) = \pi(s)$ and $f(\pi(s)) = \tilde f(s) = \psi(s) = \phi_i(\pi_i(s))$. Since two homomorphisms that agree on generators must agree everywhere, $f \circ j_i = \phi_i$ on all of $G_i$.
[/guided]
[/step]
[step:Prove uniqueness of $f$]
Suppose $f': G_1 * G_2 \to K$ is another homomorphism satisfying $f' \circ j_i = \phi_i$ for $i = 1, 2$. For $s \in S_i$,
\begin{align*}
f'(\pi(s)) = f'(j_i(\pi_i(s))) = \phi_i(\pi_i(s)) = \psi(s).
\end{align*}
So $f' \circ \pi$ and $\tilde{f}$ are homomorphisms $F(S_1 \sqcup S_2) \to K$ agreeing on the generating set $S_1 \sqcup S_2$. By the uniqueness half of the [universal property of the free group](/theorems/1900), $f' \circ \pi = \tilde{f} = f \circ \pi$. Since $\pi$ is surjective, $f' = f$.
[/step]
[step:Conclude]
Combining Steps 2-5: the set map $\psi: S_1 \sqcup S_2 \to K$ extends uniquely to $\tilde{f}: F(S_1 \sqcup S_2) \to K$, which descends to $f: G_1 * G_2 \to K$ satisfying $f \circ j_i = \phi_i$; and this $f$ is the unique homomorphism with this property. This establishes the universal property of the free product.
[/step]