Proof that a Limit equals a Function Let f(x) = $\frac{x}{|x|}$ if x $\neq$ 0, and define f(0)=0. Show that
f(x) = $\lim_{n \rightarrow \infty} \frac{2}{\pi} \tan^{-1}(nx)$



My work: 
$\frac{x}{|x|}$ = $\lim_{n \rightarrow \infty} \frac{2}{\pi} \tan^{-1}(nx)$ 
$\frac{x}{|x|}$ = $\lim_{n \rightarrow \infty} \frac{2}{\pi} \frac{cos(nx)}{sin(nx)}$ 
$\lim_{n \rightarrow \infty} cos(n)$ = -1 and 1, likewise $\lim_{n \rightarrow \infty} sin(n)$ = -1 and 1. 
So when $\frac{-1}{-1}$ and $\frac{1}{1}$ then the limit is equal to 1. Likewise when $\frac{-1}{1}$ and $\frac{1}{-1}$ then the limit is equal to -1. 
f(x) always equals either 1 or -1 so they can be confirmed to be equivalent. However, I'm having problems with the $\frac{2}{\pi}$ and the effects of x in the limit. 

Hints please! Thanks!
 A: If $x = 0$, $\frac{2}{\pi} \tan^{-1}(nx) = 0$ for all $n$, and thus $\lim_{n\to \infty} \frac{2}{\pi}\tan^{-1}(nx) = 0$ when $x = 0$. If $x > 0$, then $$\lim_{n\to \infty} \frac{2}{\pi} \tan^{-1}(nx) = \frac{2}{\pi}\lim_{u\to +\infty} \tan^{-1}(u) = \frac{2}{\pi}\cdot\frac{\pi}{2} = 1 = \frac{x}{|x|}.$$ If $x < 0$, then $$\lim_{n\to \infty} \frac{2}{\pi}\tan^{-1}(nx) = \frac{2}{\pi} \lim_{u\to -\infty} \tan^{-1}(u) = -1 = \frac{x}{|x|}.$$ Hence, for all $x\neq 0$, $\lim_{n\to \infty} \frac{2}{\pi}\tan^{-1}(nx) = \frac{x}{|x|}$.
A: Here is an approach.
Recall that
$$
\tan^{-1} x +\tan^{-1} \frac1x = {\rm{sign}}\:x \: \cdot\frac \pi 2, \qquad x\neq 0, \tag1
$$ and that, for $u$ near $0$,
$$
\tan^{-1} u  = u +\mathcal{O}\left(u^3\right). \tag2
$$
Then, using $(1)$ and $(2)$, we have, for $x \neq 0$,
$$
\begin{align}
\lim_{n \rightarrow \infty} \frac{2}{\pi} \tan^{-1}(nx)&= \lim_{n \rightarrow \infty} \frac{2}{\pi} \left({\rm{sign}}\:nx \: \cdot\frac \pi 2- \tan^{-1}\left(\frac{1}{nx}\right)\right)\\\\
&={\rm{sign}}\:x - \frac{2}{\pi}\lim_{n \rightarrow \infty} \tan^{-1}\left(\frac{1}{nx}\right)\\\\
&={\rm{sign}}\:x - \frac{2}{\pi}\lim_{n \rightarrow \infty} \left(\frac{1}{nx}\right)
\\\\
&={\rm{sign}}\:x \\\\
&=\frac{x}{|x|}.
\end{align}
$$
