Suppose that $G=\langle S\mid R\rangle$ (where $S\subset G$ is a subset with a set of relations $R$) and that $\psi$ is a function $S\to H$ where $H$ is an arbirtrary group. Suppose further that each relation in $R$ becomes $1\in H$ if each $T\in S$ that appears in the relation is replaced by $\psi(T)$.
Show that $\psi$ can be extended to a homomorphism $G\to H$.
I have trouble understanding the concepts of relations. It is clear that the proof somehow follows from the universal property of free groups. But how exactly so? I know that $T_1^{\epsilon_1}\cdots T_k^{\epsilon_k}\in R$ maps to $\psi(T_1)^{\epsilon_1}\cdots \psi(T_k)^{\epsilon_k}=1\in H$, $\epsilon_i\in\{\pm 1\}$ but what can I derive from that other than information about the kernel as soon as I know it's a homomorphism?
I've also found this paragraph in my book:
If $G$ is an arbitrary group generated by a subset $S$, then there is a homomorphism $\phi$ from a free group $F$ of rank $|S|$ onto $G$, and so $G\cong F/\ker(\phi)$. In fact, $F$ may be chosen to be the free group based on the set $S$ itself. If an element $T\in S$ is denoted by $\hat T$ when it is considered as an element of the free group $F$ rather than as an element of $G$, then the homomorphism is the map that results from setting $\phi(\hat T)=T$ for all $\hat T\in S$.
I'm fairly sure everything I need can be found in there but how do I glue it together? Since $H$ was arbirtrary I can't treat it as the free group based on $S$.