Thm 5.19 (exactly) says: Let $\gamma\colon[a,b]\rightarrow \mathbb{C}$ be piecewise smooth. Let $F$ be a complex function defined on an open set containing $\gamma^*$, and suppose that $F'(z)$ exists and is continuous at each point of $\gamma^*$. Then $\int_\gamma F'(z)dz=F(\gamma(b))-F(\gamma(a)).$
The homework asks to determine all possible values of $\int_C \frac 1{z^2+1}dz,$ where $C$ is piecewise smooth from $z=-1$ to $z=1$, but does not include $z=i$ or $z=-i$.
Part of our answer is that if $C_1$ is straight from $-1$ to $1$ (or deformable into such a line), then the integral must equal $\arctan(1)-\arctan(-1)=\frac \pi 2$. Note that $C_1$ passes between the two singularities.
Why doesn't thm 5.19 apply to a curve which passes over (or under), both singularities (and doesn't loop either)?
If $C_2$ passes over both singularities, then it is piecewise smooth. $F$ is still defined on an open set containing $C_2$ (it's not an open disc, and it would have to be drawn carefully so as not to include either singularity, but it is open). And $F'(z)$ still exists and is continuous on the curve.
If my friend (and the perfect grade he got on his homework!), is correct, then if a curve passes over both singularities, it is equal to $\frac \pi2$.
P.S. No need to inform me about loops of the singularities. We've handled that situation using Cauchy's Integral Formula.