My professor wrote the homework questions by hand so I posted screenshots for reference.

In office hours earlier today, my professor gave my friend the answer to b) claiming that it was 0. My friend then told me that the reason for this was $\int_{T}f = 0$ because the curve is closed. However I am finding it really hard to believe this answer.
What I ended up doing was using the fact that by Cauchy's theorem, the integral along $T$ is the same as the integral around 2 unit circles centered at $0$. Then I computed the contour integral and got a nonzero number.
I don't understand what theorem or property, or even intuitively looking at this picture why the answer would be 0. Any help/independent verification would be appreciated, thanks.
Edit: How I got my answer
Just FYI Our professor did NOT teach us about residues so that knowledge technically isn't known at this point.
By Cauchy's integral formula, we have
$$f(f(z)) = \frac{1}{2\pi i}\int_{T} \frac{f(u)}{u-z}du$$ where $f(u)$ is analytic on a region containing $T$ and its interior. Since the unit circle is contained in $T$, by Cauchy's theorem we can compute the integral along a double circle. This is what I attempted to do. Using the formula $$\int_{T}f(z)dz = \int_{a}^{b}f(z(t))z'(t)dt$$ where $z'(t) = rie^{it}$ and letting $C$ be the unit circle centered at $0$, I get
\begin{align*} \int_{C}\frac{1}{z^2}z'(t)dt = \int_{0}^{2\pi}\frac{1}{r^2e^{2it}}rie^{it}dt = \frac{i}{r}\int_{0}^{2\pi}\frac{1}{e^{it}}dt = i\int_{0}^{2\pi}\frac{1}{z}dt = 2k\pi i^2 \end{align*} where we know from class that $\int_{0}^{2\pi}\frac{1}{z}dz = 2\pi i$ and the winding number is $k=2$ I got $-4\pi$ as my answer.

The function $\frac{1}{z^2}$ has a pole at $0$, so your gut feeling that using the closure of the curve is not sufficient for the integral to be $0$ is correct. In fact, for a different, but very similar function which also has a pole at $0$, the integral doesn't vanish: $\frac1z$.
In the comments it was said that $\frac{1}{z^2}$ has $0$ as a residue, so the integral vanishes. But philosophically speaking, that's the wrong way around: $\frac{1}{z^2}$ has $0$ residue because the integral along your given curve vanishes. If it didn't vanish, we'd have defined the residue differently, so it wouldn't be $0$.
The deeper reason why this integral vanishes is the fact that your function has an antiderivative. If a holomorphic function has an antiderivative on the entirety of its domain, then contour integrals only depend on the start and end points of the contour, which makes closed integrals vanish. And $\frac{1}{z^2}$ has an antiderivative: it's $-\frac{1}{z}$. In contrast, the example $\frac{1}{z}$ does not have an antiderivative on its entire domain. Such an antiderivative would have to be a holomorphic branch of the logarithm, but no such branch exists on the punctured plane $\mathbb C\backslash\{0\}$. That's why closed integrals over that function don't necessarily vanish.