Taking the Fourier transform, we have $$ \widehat{f} = \widehat{g}^2, $$ so that $\widehat{g} = \sqrt{\widehat{f}}$. Then take the inverse Fourier transform to find $g$. This doesn't quite work, I think, because you have to choose a branch of the square root. I think this shows the solution is not unique, but you can still find them by this method.