Let $X,Y$ be two path-connected topological spaces and $\langle A\mid R\rangle,\langle B\mid S\rangle$ respectively presentations for their fundamental groups. I think that a presentation for the fundamental group of the wedge sum $X\vee_{x_{0}} Y$ is $\langle A\sqcup B\mid R,S\rangle$.
All one should prove is that if $f$ is a loop in $X$ and $g$ a loop in $Y$ (both with base-point $x_{0}$) such that $f\cdot g\simeq g\cdot f$ in $X\sqcup Y$, then at least one of the two loops is homotopic to $x_{0}$ in his own space. How can I prove this?
I'd tried taking a homotopy $H$ between $f\cdot g$ and $g\cdot f$, and analize the possible preimages by $H$ of $x_{0}$. I saw that these preimages must contain curves of this form or similar:

and this could give the needed homotopy.
I'm not sure that this reasoning is right and how to complete. Can anyone help me please? Thank you very much.