Let $\phi : G\to G'$ be a homomorphism and let $S'\subseteq G'$. Is $\phi^{-1}(\langle S'\rangle ) = \langle \phi^{-1}(S')\rangle$? I've shown that $\phi^{-1}(\langle S'\rangle ) \supseteq \langle \phi^{-1}(S')\rangle$ and was wondering whether the other inclusion holds, although I've not been able to prove it nor find a counterexample.

I case it helps, one may use the fact that if $S\subseteq G$, then
$$\phi(\langle S\rangle) = \langle \phi(S)\rangle.$$

Hints: Let $S'_{0}=S'\cup\{a^{-1}\mid a\in S'\}$. We go to prove that $\langle S'\rangle=\cup_{n\in\mathbb{N}}\{a_{1}a_{2}\ldots a_{n}\mid a_{i}\in S'_{0}\}$.
Clearly $RHS\subseteq\langle S'\rangle$ and $RHS$ contains $S'$.
We verify that $RHS$ is a subgroup of $G'$. Let $x,y\in RHS$. Write
$x=a_{1}\ldots a_{m}$ and $y=b_{1}\ldots b_{n}$ for some $a_{i},b_{j}\in S'_{0}$.
We have that $xy=a_{1}\ldots a_{m}b_{1}\ldots b_{n}\in RHS$ and $x^{-1}=(a_{m})^{-1}\ldots(a_{1})^{-1}\in RHS$.
Since $\langle S'\rangle$ is the smallest subgroup of $G'$ containing
$S'$, it follows that $RHS\supseteq\langle S'\rangle$.
