Complex analysis exercises

The function $g(z)= \frac{p(\frac{1}{z})}{q(\frac{1}{z})}$ has a removable singularity at $0$ since the $ \lim_{z \rightarrow \infty }\frac{p(z)}{q(z)}$ exists. Furthermore since $p(z),q(z)$ have all their zeros inside $|z|=1\,$ , the functions $g(z)$ and $\frac{1}{g(z)}$ are analytic in $|z|<1+\epsilon\,$ , for some $\,\epsilon >0\,$ , so by the maximum principle both functions $\left(|g(z)|, \left|\frac{1}{g(z)}\right|\right)$ are bounded by $1$ for $ |z| \leq 1$ since the condition $|p(z)|=|q(z)|$ for $|z|=1$ that means $|g(z)|=1$ for $|z| \leq 1$ and you are done.