The given expression can be written as $$\tan^{-1}(\frac{r+1+(-r)}{1-(-r)(r+1)})$$
$$=\tan^{-1}(r+1)-\tan^{-1}(r)$$
Therefore $$\sum =\tan^{-1}(1)-\tan^{-1}(0)+\tan^{-1}(2)....$$
Since it goes on to infinity, all the terms except $-\tan^{-1}(0)$ get cancelled. So the answer should be $0$ or $-\pi$. But the right answer is $\frac{\pi}{2}$. What’s wrong with this solution?
I know how to get $\frac{\pi}{2}$, I figured out an alternate for it, but I want to know what went wrong here.
You're almost there. The $k$-th partial sum is given by $\text{tan}^{-1}(k+1) - \text{tan}^{-1}(0) = \text{tan}^{-1}(k+1)$. As $k \rightarrow \infty$, the partial sum converges to $\pi /2$.