How to compute the fourier transform of $\operatorname{sgn}$ directly? I've been trying to compute the fourier transform of $\operatorname{sgn}(x)$, but I'm having trouble with the complex exponential at infinity. The issue is the following: by definition we have
$$(\mathcal{F}[\operatorname{sgn}(x)](k),\phi(k))=(\operatorname{sgn}(x),\mathcal{F}[\phi(k)](x))=\dfrac{1}{2\pi}\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}\operatorname{sgn}(x)\phi(k)e^{ikx}dkdx.$$
If we apply the definition of $\operatorname{sgn}$, we can easily see that
$$(\mathcal{F}[\operatorname{sgn}(x)](k),\phi(k))=\dfrac{1}{2\pi}\int_{-\infty}^{\infty}\phi(k)\left(\int_{-\infty}^0-e^{ikx}dx+\int_{0}^\infty e^{ikx}dx\right)dk.$$
Now on the inner integrals, if we integrate directly we would have
$$\int_{-\infty}^0-e^{ikx}dx+\int_{0}^\infty e^{ikx}dx=\int_0^\infty e^{ikx}-e^{-ikx}dx,$$
but this is
$$\int_{-\infty}^0-e^{ikx}dx+\int_{0}^\infty e^{ikx}dx=2i\int_0^\infty \sin{kx}dx$$
which we know that doesn't exist.
In that sense something is clearly wrong here but I'm not being able to see what. I believe my method is totally wrong here, but I can't see why.
What am I doing wrong? And how can we compute this fourier transform correctly?
 A: The problem with writing down an improper integral $\int_{-\infty}^\infty$ and then maybe trying to find $\lim_{L\to\infty} \int_{-L}^L$ is that this truncation is too rough for such heavy-tailed function as $\operatorname{sign}$. This is why you can't  get anything to converge. 
The link given by zahbaz describes a better approximation, $e^{-\epsilon |x|} \operatorname{sign}x$ where $\epsilon\to 0$. For these functions the transform can be computed directly: 
$$F_\epsilon(\omega) = -\frac{2i\omega}{\omega^2+\epsilon^2}$$
and the limit as  $\epsilon\to 0$ exists: $2/(i\omega)$. Note that the Fourier transform is continuous on the space of distributions: distributional convergence $f_n\to f$ implies distributional convergence $\hat {f_n}\to \hat f$.
A less direct, but easier, way is to recall that the distributional derivative of $\operatorname{sign}x$ is $2\delta_0$, and the Fourier transform of $\delta_0$ is just the constant function $2$ (under your normalization of the transform). Since $f'$ transforms to $ i\omega \hat f(\omega)$, it follows that the Fourier transform of $\operatorname{sign} x$ is $2/(i\omega)$.
