We talk about $\tan^{-1}(x)$ in $(-\frac{\pi}{2} \ \ \frac{\pi}{2})$ interval because it's one-to-one. But we can also consider other intervals like $(\frac{\pi}{2},\pi)$ , $(\pi,\frac{3\pi}{2}),\dots$. When we want to find value of $\tan^{-1}(\tan(\frac{4\pi}{3}))$ , the $\frac{4\pi}{3}$ is wrong answer because it's not in $(-\frac{\pi}{2},\frac{\pi}{2})$ interval. But I think we can say $\tan^{-1}(\tan(x)) = x $ or $\tan(\tan^{-1}(x)) = x $ in any intervals (that is pointed out)
What's my mistake ?