Let $G:=S_5$ with elements $g_1=(12345)$ and $g_2=(12)$ and let $\varphi:F_2\to G$ be the unique homomorphism satisfying $\varphi(x_i)=g_i$ for $i=1,2$
Questions
$\bullet$ Is $\varphi(x_2^{-1})=\varphi(x_2)^{-1}$ here ?
$\bullet$ How can I find an element $w$ of $F_2$ such that $\varphi(w)=(34)$
In general $g_1$ and $g_2$ generate $G$, to write $(34)$ in terms of $g_1,g_2$, I did:
$\varphi(w)=(34)=(14)(13)(14)=\underbrace{\Big((13)(12345)(13)\Big)}_{(14)}(13)\Big((13)(12345)(13)\Big)$
$=(13)(12345)(13)(12345)(13)\tag I$
$$=\underbrace{\Big((12)(12345)(12)\Big)(12)\Big((12)(12345)(12)\Big)^{-1}}_{(13)}(12345)...$$
but $((12)(12345)(12))^{-1}=(12)^{-1}(12345)^{-1}(12)^{-1}=(12)(12345)^4(12)$
and so if $g_1$ corresponds to $x_1$, then $(13)$ corresponds to $x_2x_1x_2x_1^4x_2$ and the word $w$ is just the ''juxtaposition'' of these $2$ according to $(I)$, is that correct ?
First question: Yes, because $\phi$ is a homomoprhism.
Second: Yes, simply put if you find an expression in the $g_i$ that produces a desired element of $G$, just replace all letters "$g$" with "$x$" and you obtain an element of $F_2$ that is mapped as desired. (Actually, I would have found a different solution by conjugating $g_2$ with $g_1^2$, but of course there are many possible solutions ...)