Counting finite zeros among infinite zeros Let $G$ be open in $\mathbb{C}$ and $f:G\rightarrow \mathbb{C}$ be an analytic function.
Let's denote $\deg(f,z)$ to mean the multiplicity of a zero $z$ of $f$, and $Z(f)$ to mean the set of zeros of $f$.
Let $\gamma:[0,1]\rightarrow \mathbb{C}$ be a closed rectifiable curve which does not pass through zeros of $f$ and $\operatorname{Wnd}(\gamma,z)=0$ for all $z\in \mathbb{C}\setminus G$.
If $f$ has finitely many zeros in $G$, then $$\frac{1}{2\pi i} \int_\gamma \frac{f'(z)}{f(z)} dz = \sum_{z\in Z(f)} \deg(f,z) \operatorname{Wnd}(\gamma, z).$$ It's easy to prove this.
However, I'm curious whether the above equality holds in general.
So let's assume that $f$ has infinitely many zeros in $G$.
Since the set $\{z\in G:\operatorname{Wnd}(\gamma,z)\neq 0\}$ is relatively compact in $G$, $f$ has only finitely many zeros in $G$ whose winding numbers are nonzero. Hence, the term $\sum_{z\in Z(f)} \deg(f,z)\operatorname{Wnd}(\gamma,z)$ is well-defined.
So to prove the equality above, it suffices to prove the following statement:

Let $g:G\rightarrow \mathbb{C}$ be an anlytic function and $\gamma$ be a closed rectifiable curve in $G$ which does not pass through zeros of $g$ and $Wnd(\gamma,z)=0$ for all $z\in\mathbb{C}\setminus G$.
If any zero $z$ of $g$ satisfies $Wnd(\gamma,z)=0$, then $\int_\gamma \frac{g(z)}{g'(z)}dz= 0$

How do I prove this? If this is false, what would be a counterexample?

You can just replace $G$ by $G\setminus g^{-1}(\{0\})$, and now you've reduced to the case where $g$ has no zeroes in $G$.
