Suppose we have groups $G,H$, a subsemigroup $S$ of $G$ generating $G$ as a group, and a homomorphism $f\colon S\to H$.
When does $f$ extend to a homomorphism $G\to H$?
If $f$ is injective, when does it extend to an injective homomorphism $G\to H$?
Aside from the trivial case (when $S=G$, which is the case e.g. if $G$ is torsion), I think this is true when $G$ is abelian.
In this case, every element of $G$ can be written as $g_1g_2^{-1}$ for $g_1,g_2\in S$, and $g_1g_2^{-1}\mapsto f(g_1)f(g_2)^{-1}$ is well-defined: if $g_1g_2^{-1}=g_3g_4^{-1}$, then $g_1g_4=g_3g_2$, so $f(g_1g_4)=f(g_1)f(g_4)=f(g_3g_2)=f(g_3)f(g_2)$, so $f(g_1)f(g_2)^{-1}=f(g_3)f(g_4)^{-1}$.
It is also easy to check that it defines a homomorphism, which is injective if $f$ is.
I think the same argument works more generally if we assume that there is a central semigroup $B\subseteq S^{-1}$ such that $G=SB$.
I don't actually have any counterexamples, so I'd be interested in seeing those, too.
Here are counterexamples to extendability, and to the extension of a one-to-one map being one-to-one when it exists.
Let $G=\mathbb{Z}*\mathbb{Z}_2$, the free product, with generato of infinite order $x$ and $y$ of order $2$. Let $S$ be the subsemigroup generated by $x$ and $xy$. This is the free semigroup of rank $2$, as no two positive words in $x$ and $xy$ are equal unless they are identical.
Now let $H$ be the free group of rank $2$ generated by $a$ and $b$. The semigroup homomorphism $S\to H$ mapping $x$ to $a$ and $xy$ to $b$ cannot be extended to $G$ because $y$ is torsion, so it must map to the identity.
Going the other way, you can embed the subsemigroup of $H$ generated by $a$ and $b$ into $G$, and the map of course extends to all of $H$, but the extension is not one-to-one, so even when you can extend, injectivity need not be preserved.