Let $\gamma(t) = 2e^{it}$ for $-\pi \le t \le \pi$. I am looking for an explanation for the way $\int_{\gamma}(z^{2} - 1)^{-1} dz$ is evaluated below. The following is a problem from Conway's Functions of One Complex Variable. Let $\gamma(t) = 2e^{it}$ for $-\pi \le t \le \pi$. The problem asks to evaluate $\int_{\gamma}(z^{2} - 1)^{-1} dz$.
The solution I have says that because $T(z)=\frac{z-1}{z+1}$ preserves $\mathbb{R}_{\infty}$, then $T(z)$ is in $\mathbb{R}_{\le 0} \cup \{\infty\}$ iff $z \in \mathbb{R}$ and $-1 \le z \le 1$. How can I see that the iff statement is true?
The solution then goes on to say that this means that away from that interval and in particular, on an open set containing $\gamma$, we have that $\log \frac{z-1}{z+1}$ is well-defined. I don't exactly see how the logic for log being well-defined follows either and would appreciate if someone can provide an explanation. How can we be away from the interval $-1 \le z \le 1$ when it's inside $\gamma$?
After all of this, the solution is that $\frac{1}{2} \log \frac{z-1}{z+1}$ is a primitive of $f(z)=\frac{1}{z^{2}-1}$, so the integral around the closed curve $\gamma$ will be $0$.
 A: It's so much easier to observe the following two things: both poles, $\pm1$, of the integrand are enclosed by the contour with positive orientation, and we can compute the residues at each pole with L'Hopital's rule (they are simple poles) by: $$\frac{1}{2z}\Big|_{z=\pm1}=\pm\frac{1}{2}$$Because the signs are opposite, the sum of residues is zero. So, the integral is zero.

Anyway. Say $z=\sigma+i\tau$ has ($\sigma,\tau\in\Bbb R$) $T(z)\in(\Bbb R_{\le0}\cup\{\infty\})$. We want to show this occurs when and only when $\tau=0,\sigma\in[-1,1]$.
$T(z)=\infty$ means exactly that $z=-1$, just because that's the only pole. In the other case, $T(z)\in\Bbb R$, we can compute: $$\frac{z-1}{z+1}=\frac{(\sigma-1)+i\tau}{(\sigma+1)+i\tau}=\frac{(\sigma^2-1+\tau^2)+2i\tau}{(\sigma+1)^2+\tau^2}$$This is real iff. the imaginary part is zero, iff. $\tau=0$. Then, the real part is $\frac{\sigma-1}{\sigma+1}$, which is asked to be nonpositive. It's easy to see that is true iff. $\sigma\in(-1,1]$.  The claim is true.
Now, let's use $\log$ to denote the principal logarithm, which is holomorphic on $\Bbb C\setminus\Bbb R_{\le0}$. So, $z\mapsto\log\frac{z-1}{z+1}=\log T(z)$ is holomorphic at $z$ if and only if $T(z)$ is finite and not in $\Bbb R_{\le0}$, that is, if and only if $z\in\Bbb C\setminus[-1,1]$ by the claim.
So, on $\Bbb C\setminus[-1,1]$, we can see that $$z\mapsto\frac{1}{2}\log\frac{z-1}{z+1}$$Is a primitive of $z\mapsto(z^2-1)^{-1}$.
Are there open sets containing the (trace of) $\gamma$ that avoid $[-1,1]$? Yes, there are. For example, the annulus: $$\{z\in\Bbb C:\frac{3}{2}<|z|<\frac{5}{2}\}$$
$[-1,1]$ is "contained" in $\gamma$ in the sense that it is enclosed by the contour, but it is not a literal subset of $\gamma$.
