I have found the proofs of the argument principle from Ponnusamy and Silverman's Complex variables with applications and Brown and Churchill's Complex variables. But I am not sure how to make sense of the argument function, which is not analytic or continuous in the full circle due to requiring a branch cut.
To start with, this is from Ponnusamy and Silverman.
Let $f(z)$ be analytic inside and on a simple closed contour $C$ except for a finite number of poles inside $C$, and suppose $f(z)\neq 0$ on $C$. If $N_f$ and $P_f$ are respectively, the number of zeros (a zero of order $k$ being counted $k$ times) and poles (again with multiplicity) inside $C$, then $$\frac{1}{2\pi i}\int_C \frac{f'(z)}{f(z)}dz = N_f - P_f.$$
The phenomenon that the integral is always an integer is based on properties of the logarithm. Suppose that $f(z)$ is analytic and nonzero for all $z$ on a simple closed contour $C$. Set $$\log f(z)= \ln |f(z)|+i \arg f(z),$$ where a fixed branch for the logarithm is chosen. Then $$\int_C \frac{f'(z)}{f(z)}dz = \int_C d(\log(f(z))=\ln |f(z)| |_C + i \arg f(z)|_C.$$
Since the initial and terminal points of the closed contour $C$ must coincide, $\ln |f(z)| |_C =0.$ Hence $$\int_C \frac{f'(z)}{f(z)}dz = i\arg f(z)|_C.$$ Thus the value of the integral depends only on the net change in the argument of $f(z)$ as $z$ traverses the contour $C$.
Next, this is from Brown and Churchill.
First, we let $z=z(t)$ $(a\le t \le b)$ be a parametric representation for $C$, so that $$\int_C \frac{f'(z)}{f(z)}dz = \int_a^b \frac{f'[z(t)]z'(t)}{f[z(t)]}dt.$$ Since, under the transformation $w=f(z),$ the image $\Gamma$ of $C$ never passes through the origin in the $w$ plane, the image of any point $z=z(t)$ on $C$ can be expressed in exponential form as $w=\rho(t)\exp[i\phi(t)].$ Thus $$f[z(t)]=\rho(t)e^{i\phi(t)} \;(a\le t\le b),$$ and, along each of the smooth arcs making up the contour $\Gamma$, it follows that $$f'[z(t)]z'(t)=\frac{d}{dt} f[z(t)] = \frac{d}{dt}[\rho(t)e^{i\phi(t)}]= \rho'(t)e^{i\phi(t)} + i\rho(t)e^{i\phi(t)}\phi'(t).$$ Inasmuch as $\rho'(t)$ and $\phi'(t)$ are piecewise continuous on the interval $a\le t\le b,$ we can now use the above expressions to write integral as follows: $$\int_C \frac{f'(z)}{f(z)}dz = \int_a^b \frac{\rho'(t)}{\rho(t)}dt + i\int_a^b \phi'(t)dt = \ln \rho(t)|_a^b + i\phi(t)|_a^b. $$ But $\rho(b)=\rho(a)$ and $\phi(b)-\phi(a)=\Delta_C \arg f(z).$ Hence $$\int_C \frac{f'(z)}{f(z)}dz = i \Delta_C \arg f(z).$$
Question. In the first argument, we need to fix a branch cut for $\log$, say $\alpha < \theta < \alpha+ 2\pi$. But as $f(z)$ traverses around a full cycle, this means that it will cross the branch cut. So how can we use $\int_C \frac{f'(z)}{f(z)}dz = \int_C d(\log f(z))$ when the antiderivative $\log f(z)$ is not defined in $C$?
Similarly in the second argument, when we express $f(z(t))=\rho(t)e^{i\phi(t)}$, $\phi(t)$ is essentially $\arg f(z(t))$, but this function, similarly to the logarithm, should require a branch cut to be defined analytically. So how do we get $\phi'(t)$ in $[a,b]$?
I am confused how the logarithm of $f(z)$ can be used as an antiderivative when it is defined only on a fixed branch, whereas the integral may be taken over where $f(z)$ crosses the branch. I would greatly appreciate some help clarifying these points.