Endomorphism of a group Let $G$ be a group with presentation 
$$G=\langle x_1,x_2,\cdots,x_k\colon R_1(x_1,\cdots,x_k)=1, \cdots, R_n(x_1,\cdots,x_k)=1\rangle.$$
Here $R_i(x_1,\cdots,x_k)$ denotes a word in $x_1,\cdots,x_k$.
Suppose $y_1,y_2,\cdots,y_k$ are elements of $G$ such that in $G$, $$R_i(y_1,\cdots,y_k)=1.$$
Question: Does the map $x_i\mapsto y_i$ extends to homomorphism (endomorphism) of $G$?
I was thinking YES; but unable to give clear justification. Any suggestion on problem?
 A: Note that if $h : A \to B$ is a group morphism, then 
$$
h(R_i(a_1,\dots,a_n)) = R_i(h(a_1),\dots,h(a_n)).
$$
for any $a_1, \dots, a_n \in A$. Now, the function between sets 
$$
f : x_i \in \{x_1,\dots,x_n\} \mapsto y_i \in G
$$ 
induces a group morpshism which I will note with the same name
$$
\begin{align}
f : F(x_1,\dots,x_n) \to G
\end{align}
$$
and moreover we have $f(x_i) = y_i$. By our first observation, we have that 
$$
f(R_i(x_1,\dots,x_n)) = R_i(f(x_1),\dots,f(x_n)) = R_i(y_1,\dots,y_1) = 1,
$$ 
and so $f$ factors through the quotient
$$
\begin{align}
&F(x_1,\dots,x_n)/\langle\langle R_i(x_1,\dots,x_n) \rangle\rangle_{i \in \{1,\dots,n\}} \\
&=\langle x_1,\dots,x_n | R_i(x_1,\dots,x_n) = 1, 1 \leq i \leq n\}\\&= G.
\end{align}
$$
(The elements $x_i \in G$ are the images of each $x_i$ in the free group, i.e. formally in $G$ we have the classes $[x_i]$ of each element, and thus $\bar{f}(x_i)$ is notation for $\bar{f}(q(x_i))$ with $q$ the canonical projection.) 
Therefore, there exists a morphism $\bar{f} : G \to G$ such that 
$$
\bar{f}(x_i) = f(x_i) = y_i
$$
as desired.
