Finding an $N$-th root for $\prod_{k=1}^N (z- a_k)$, where $a_1, \dots, a_N \in \mathbb{C}$ Let $a_1, \dots, a_N$ be distinct complex numbers. Let $\Omega$ be the domain obtained from $\mathbb{C}$ by removing each closed line segment connecting $a_k$ to origin, $k =1, \dots, N$.
Explicitly construct an analytic function $f$ on $\Omega$ such that $f(z)^N =  \prod_{k=1}^N (z- a_k)$ for all $z \in \Omega$.  
I am preparing for my qualifying exam in complex analysis, and this problem appears on an old exam. I'm hoping to get some hints for this problem, and then I'll post my own solution.
With similar problems in my course, we would try to find this $N$-th root by exponentiating a "log" function of sorts. That is, for $a \in \Omega$, we set
$$f(z) = e^{\frac{1}{N}\int_{\gamma_a^z}\frac{g'(w)}{g(w)}dw},$$
where $\gamma_a^z$ is any smooth path in $\Omega$ from $a$ to $z$, and $g(z) = \prod_{k=1}^N (z- a_k)$. The hard part for me is showing that this function $f$ is well-defined. That is, if $\gamma_a^z$ and $\rho_a^z$ are two smooth paths, how can I demonstrate that  
$$e^{\frac{1}{N}(\int_{\gamma_a^z}\frac{g'(w)}{g(w)}dw -\int_{\rho_a^z}\frac{g'(w)}{g(w)}dw )}= 1?$$
I think I may need to use the General Residue Theorem or something related, but I'm getting confused. In this situation, it seems there are closed paths $ \Gamma =\gamma_a^z - \rho_a^z$ for which the index $\operatorname{Ind}_\Gamma(w) \neq 0$ for some $w \in \mathbb{C} \setminus \Omega$ (take for instance, $\Gamma = \gamma_a^z - \rho_a^z$ to be some circle in $\Omega$ that's centered at $0$, and just take $w = 0$).
Hints about how to show well-definedness are greatly appreciated.
 A: First of all, your idea is correct. If $f(z)^N = g(z)$, then we naturally think of $f(z) = \sqrt[n]{g(z)}$. To make sense of takeing n-th square root, we always think about using exp and log.
Now your $g(z) = \Pi_{k = 1}^N(z - a_k)$ is a well-defined non-vanishing holomorphic function on $\Omega$, so $\frac{g'(w)}{g(w)}$ is well-defined holomorphic function on $\Omega$. However, the problem occurs at defining $\int_a^z\frac{g'(w)}{g(w)}dw$ since our domain $\Omega$ is not simply connected. Or we can look at the problem in your way, if we take $\Gamma = \gamma_a^z - \rho_a^z$, then the integral $\int_\Gamma\frac{g'(w)}{g(w)}dw$ does not vanish, so different path gives you different value for the integral. In fact, we know that the value of $\frac{1}{2\pi i}\int_\Gamma\frac{g'(w)}{g(w)}dw$ equals to the number of zeros of $g(z)$ inside of the curve $\Gamma$.
The main reason why our $f(z) = e^{\frac{1}{N}\int_a^z\frac{g'(w)}{g(w)}dw}$ is well-defined is that any closed curve in $\Omega$ must go around each zeros $a_k$ the same number of times, i.e. $Ind_\Gamma(a_k) = Ind_\Gamma(a_l)$ for any $k, l$. So we see that $\frac{1}{2\pi i}\int_\Gamma\frac{g'(w)}{g(w)}dw = NM$, where $M = Ind_\Gamma(a_k)$, and therefore $e^{\frac{1}{N}\int_\Gamma\frac{g'(w)}{g(w)}dw} = e^{2M\pi i} = 1$. Therefore our $f(z)$ is well-defined.
It would be helpful to think about the easiest case when $N = 2$. I can give you this simple exercise: show that the function $\sqrt{(z - a)(z - b)}$ (with $a < b \in \mathbb{R}$) can be well-defined holomorphic on $\mathbb{C} - [a, b]$ the whole plane deleting a line segment.
