Question 403583
You have proved the sufficiency part, or the (==>) part.

To prove the necessity part, or the (<==), we proceed as follows:

Assume {{{gh  =m^2}}} for some m in G. We have to find to find k such that k*g*k = h.

Now {{{gh  =m^2}}} ==> {{{m^(-1)(gh)m^(-1) = 1[G]}}}.  (We can do this by the existence of the inverse element in G, as well the existence of identity element {{{1[G]}}}).
Left multiply both sides by h, to get

{{{hm^(-1)(gh)m^(-1) = h}}}
By associativity,
{{{(hm^(-1))g(hm^(-1)) = h}}}.
Therefore k exists, and is equal to {{{hm^(-1)}}}.