Assume first that $T^2 =I$. Then, we note automatically that $\ker (T-I) \cap \ker (T+I) = 0$, since if $v \in \ker(T-I)\cap \ker (T+I)$, then we see that $v = -v$, its additive inverse, so that $v = 0$ identically.
Now we employ rank nullity theorem: We know that $\dim V = \dim \textrm{im} (T-I) + \dim \ker (T-I)$, so that if we choose $v \notin \ker (T-I)$, we conclude that $v \in \textrm{im} (T-I)$ (basically, $V = \ker (T-I) + \textrm{im} (T-I)$).
Using this, assume this is so. Then, $v = (T-I)(u)$ for some $u \in V$. Now apply $T+I$ to both sides: We have:
$$(T+I)(v) = (T+I)(T-I)(u) = (T^2 - I)(u) = 0$$
Since $T^2 = I$. Thus, $\ker (T+I) = \textrm{im} (T-I)$. We can put this together with the above to conclude $V = \ker (T-I) \oplus \ker (T+I)$.
Conversely, suppose $V = \ker (T-I) \oplus \ker (T+I)$. Then, given $v \in V$, we know it is of the form $v = u + w$ with $u \in \ker (T-I)$, $w \in \ker (T+I)$.
Then apply $T$ once to both sides:
$$T(v) = T(u) + T(w) = u - w$$
Apply $T$ once more:
$$T^2 (v) = T(u) - T(w) = u + w = v$$
So that $T^2 = I$, as desired.