After some alegbra, we find that the integral equals:
$$\frac{1}{4}\int_{-\infty}^{\infty}\frac{2e^{-ikx}+e^{i(2-k)x}+e^{-i(2+k)x}}{x^2}dx$$.
Now since $k\in[0,2]$, for contour integration, we consider the LHP for the first and third term in the integrand and then the UHP for the second term.
If we call $C_{\epsilon,U}$ the semi-circle of radius $\epsilon$ in the UHP, $C_{\epsilon,L}$ the semi-circle of radius $\epsilon$ in the LHP, $C_{R,U}$ the semi-circle of radius $R$ in the UHP, $C_{R,L}$ the semi-circle of radius $R$ in the UHP, with closed contours $\Gamma_{U}$ and $\Gamma_{L}$, we have:
$$\int_{-\infty}^{\infty}=\lim_{R\to\infty}\lim_{\epsilon\to 0}\Bigg(\int_{\Gamma_U}-\int_{C_{\epsilon,U}} -\int_{C_{R,U}}\Bigg) \text{ for the second term}$$
$$\int_{-\infty}^{\infty}=\lim_{R\to\infty}\lim_{\epsilon\to 0}\Bigg(-\int_{\Gamma_L}-\int_{C_{\epsilon,L}} -\int_{C_{R,L}}\Bigg) \text{ for the remaining terms}$$
(Note the negative sign in line 2 due to negative orientation of $\Gamma_L$)
No poles lie inside the closed $\Gamma_U$ and $\Gamma_L$ so the first integral on the RHS of each line is zero, and the last integral on the RHS each line $\to 0$ as $R\to \infty$.
So, for the top line, we're left with:
$$ \frac{1}{4}\int_{-\infty}^{\infty}\frac{e^{i(2-k)x}}{x^2}dx=-\frac{1}{4}\lim_{\epsilon\to 0}\int_{C_{\epsilon,U}}\frac{e^{i(2-k)z}}{z^2}dz=-\frac{1}{4}\lim_{\epsilon\to 0}\int_{\pi}^{0}\frac{e^{i(2-k)\epsilon e^{i\theta}}}{\epsilon^2e^{2i\theta}}i\epsilon e^{i\theta}d\theta$$.
Expanding $e^{i(2-k)\epsilon e^{i\theta}}=1+i(2-k)\epsilon e^{i\theta}+...$ (can ignore higher order terms as they tend to $0$ as $\epsilon \to 0$).
So we get (for the second term in the original integrand): $$\frac{1}{4}\lim_{\epsilon\to 0}\int_{0}^{\pi}\frac{1+i(2-k)\epsilon e^{i\theta}}{\epsilon^2e^{2i\theta}}i\epsilon e^{i\theta}d\theta=\frac{1}{4}\lim_{\epsilon\to 0}\int_{0}^{\pi}\frac{ie^{-i\theta}}{\epsilon}d\theta-\frac{1}{4}\int_{0}^{\pi}(2-k)d\theta=\frac{1}{4}\lim_{\epsilon\to 0}\int_{0}^{\pi}\frac{ie^{-i\theta}}{\epsilon}d\theta-\frac{1}{4}(2-k)\pi$$
But surely this is divergent? Have I gone wrong somewhere with this? When I consider the remaining terms (the 1st and 3rd terms in the original integrand, using the LHP), using the same method I get: $$=-\frac{3}{4}\lim_{\epsilon\to 0}\int_{-\pi}^{0}\frac{ie^{-i\theta}}{\epsilon}d\theta-\frac{1}{4}(2k+2)\pi$$ which again is divergent. So summing these two results would mean that the original integral in my question is divergent (assuming my method is correct - which I don't think it is)?
Around zero
$$\frac{\cos^2(x)}{x^2}e^{-ikx} \simeq \frac{1}{x^2}$$ so the integral is surely divergent.