Here's what I did for the proof that $f(x)=\sin(x)$ is locally invertible: since $y=\sin^{-1}x$ is the inverse of $y=\sin x, y=\sin^{-1}x\iff \sin(y)=x$.
But, since $y=\sin(x)$ is not one-to-one, its domain must be restricted to $[-\frac{\pi}{2},\frac{\pi}{2}]$.
Now, how do I prove that $g(x)=\tan(x)$ is globally invertible in its domain? Also, why we choose $[-\frac{\pi}{2},\frac{\pi}{2}]$ as the interval of restriction to get $y=\sin^{-1}(x)$? Why couldn't it be $[\frac{\pi}{2},\frac{3}{2}\pi]$?
Edit: the exercise requires me to prove that $g(x)=\tan(x)$ is globally invertible on its domain (maybe it's a typo).
Edit: Corrected interval.