I am confused about the "deformation" of a closed contour that my book is doing. For reference, it is example 2.4.3 on pg. 75-76 from this free online book. The example is the integration of 1/z around a closed contour enclosing the origin. The book does not say why any special care needs to be taken here, it just goes right into doing a deformation. More specifically, this deformation essentially gets one closed contour inside of the original, except now the inside contour is traversed in such a way that the origin is no longer an issue(?). I have multiple questions about this. First, note that $\frac{1}{z} = \frac{d}{dz}(log z)$, and we know that log z has a branch point at the origin. Alright, here goes:
1.) Why does it matter how the function is behaving at the origin? We are taking a closed contour around the origin, so the function is never evaluated at this point. Our book is kind of a drag, and doesn't dwell on the finer points of integration whatsoever, so it would seem to me that if the function is defined on the path of integration then all is well. Why is this deformation necessary at all, and what is it really telling me? That as long as I go around a curve that has some orientation facing "away" from the branch point then it's fine? I seem to be missing something.
2.) I intuitively understand why the answer to this integration is $2\pi i$: log z has a branch point at the origin, so traversing this closed circuit puts us on the next branch which is known to differ by $2\pi i$. However, viewing it this way means that I was correct in saying that the above work is unnecessary, since this is just $\int_C^{}\frac{1}{z}dz = (log(r)+2\pi i)-(log(r)+0) = 2\pi i$, where I have used $z = re^{i\theta}$. Generally I can see why this reasoning would fall short, as the contour could wrap around multiple times, or do other things, but the problem specifies that it is simple and closed, so wrapping onto itself is not an issue and it can only "go up" one branch.
3.) Here's my guess at what I am incorrectly applying. In (2) I am applying the Fundamental Theorem, and perhaps the conditions for the antiderivative (log z in this case) must be analytic in some region containing the closed contour, which would include the origin and hence not satisfy my work. However, we know that log z is analytic at all points on this contour, so (again going back to (1)) why would it matter whether the integrand's antiderivative is analytic for all points inside of the contour?
Any assistance in understanding the purpose of this deformation will be greatly appreciated.