In many-body theory we know that to find the retarded Green function in frequency space $G^R(\omega)$ we first find the Matsubara time-ordered Green function $\mathcal{G}(i\omega_n)$ and then replace $i\omega_n$ with $\omega+i\eta$.
First question: is this operation well-defined? Since, for example, if I multipy $\mathcal{G}$ by $1=e^{i\beta \omega_n}$ (for the bosonic case) the replacement $i\omega_n\rightarrow \omega+i\eta$ does not give the same answer as before. I know that both of these functions are related to the Hilbert transform of the spectral weight as
$$G(z)=\int_{-\infty}^{\infty} \frac{dx}{2\pi}\frac{\rho(x)}{x-z} $$
and that makes sense to me because in that case we have a function of real variable $z$ and the replacement (analytic continuation) $z\rightarrow i\omega_n$ gives a unique answer. However the reverse operation doesn't seem to give a unique answer.
Second question: is this replacement an actual analytic continuation?