When dealing with not simply connected sets how can I prove that a function has/doesn't have a primitive? Contex:
Recently I asked a question about if $\frac{1}{z} - \frac{1}{z-1}$ is holomorphic on $0<|z|<1$ and it got me thinking say I wanted to prove that its primitive exists/doesn't exist. I know techniques through which to prove the function has a primitive, for example, if it was on an open disc and is holomorphic then the primitive exists or for example if the set is simply connected I could use Caychy's Integral Theorem and then Morera's theorem. However, I do not know about any techniques where we are dealing with sets that are not necessarily simply connected.
My question: What are techniques to check if a function has a primitive on a set that is not simply connected? (for example what can I do to prove $\frac{1}{z} - \frac{1}{z-1}$ does/nt have a primitive on $0<|z|<1$)
 A: For holomorphic functions, the existence of a primitive is equivalent to path-independence of all contour integrals. If a primitive $F$ of $f$ exists, then $\int_\gamma f(z)\mathrm dz=F(b)-F(a)$, where $a$ and $b$ are the start and end points of $\gamma$ (you can show this using the definition of the contour integral and the fundamental theorem of calculus). And for the reverse, if the contour integral is independent of the path, only depending on the start and end points, and the domain is connected, then $F(z):=\int_{z_0}^z f(w)\mathrm dw$ is a primitive, where the integral goes along any arbitrary path connecting a fixed $z_0$ to $z$. You you can show this directly via the definition of differentiability, which will give you $F'(z)=f(z)$. For disconnected domains, you can do the same construction for each connected component of the domain separately and define the primitive piecewise.
Also, path independence of the integral is equivalent to the property that integrals along closed contours all vanish. So a holomorphic function $f:D\to\mathbb C$ has an antiderivative if and only if all integrals along closed contours vanish. To show that an antiderivative doesn't exist, you can simply try to find such a contour (and such a contour is guaranteed to exist if there is no antiderivative).
To show that an antiderivative does exist is slightly more involved on the theoretical side (unless you can guess/already know a suitable primitive).  You need to show that the integral along all closed paths vanishes, and all paths are a lot. The homotopy version of Cauchy's theorem helps reduce that number by guaranteeing that integrals along homotopic paths are equal (homotopic paths are those which you can continuously deform into each other without tearing or glueing). That's fancy vocabulary for the statement that it's sufficient to test a single closed curve per hole in the domain that goes around the hole once. If those all yield vanishing integrals, then a primitive exists.
