Proving $ 4\operatorname{arccot}(2)+\arctan\left(\frac{24}7\right)=\pi $. What am I doing wrong?
You need to pay attention to where your angle is. Note that $$ \operatorname{arccot}(2)=\arctan\left(\frac12\right)\tag1 $$ and that $\arctan\left(\frac12\right)\in\left(0,\frac\pi4\right)$. The identity $\tan(2\arctan(x))=\frac{2x}{1-x^2}$ says $$ \tan\left(2\arctan\left(\frac12\right)\right)=\frac43\tag2 $$ and $2\arctan\left(\frac12\right)\in\left(\frac\pi4,\frac\pi2\right)$ so $$ 2\arctan\left(\frac12\right)=\arctan\left(\frac43\right)\tag3 $$ Thus, $4\arctan\left(\frac12\right)\in\left(\frac\pi2,\pi\right)$ and $$ \begin{align} \tan\left(4\arctan\left(\frac12\right)\right) &=\tan\left(2\arctan\left(\frac43\right)\right)\tag4\\ &=-\frac{24}7\tag5 \end{align} $$ Therefore, $$ 4\arctan\left(\frac12\right)=\pi-\arctan\left(\frac{24}7\right)\tag6 $$ Putting together $(1)$ and $(6)$ gives $$ 4\operatorname{arccot}(2)+\arctan\left(\frac{24}7\right)=\pi\tag7 $$