Questions concerning an improper Riemann integrable funciton
As you showed, the Weierstrass test implies uniform convergence, for all $x$, of the improper integral
$$\int_{-\infty}^{\infty} \frac{\partial}{\partial x} e^{-t^2} \cos(xt) \, dt$$
In turn this implies that $f$ is differentiable and the interchange of derivative and integral is permissible -- by a widely known theorem (see, for example, The Elements of Real Analysis by Bartle).
Regarding the identity $xf(x) = -2f'(x)$, note that by taking the real part of a complex exponential and completing a square we have
$$f(x) = \int_{-\infty}^{\infty}e^{-t^2} \cos(xt) \, dt = \Re\int_{-\infty}^{\infty}e^{-t^2} e^{ixt}\, dt = e^{-x^2/4} \,\Re \int_{-\infty}^{\infty}e^{-(t-ix/2)^2}\, dt \\ = e^{-x^2/4} \,\Re \int_{-\infty-ix/2}^{\infty+ix/2}e^{-z^2}\, dz \\ = e^{-x^2/4} \int_{-\infty}^{\infty}e^{-t^2}\, dt $$
The reduction of the complex contour integral to the real integral $\int_{-\infty}^{\infty} e^{-t^2} \,dt$ follows because $z \to e^{-z^2}$ is analytic. By integrating around a rectangular contour, where one side is the interval $[-R,R]$ on the real axis, we get, with $z = t + iu$,
$$0 = \int_{-R}^Re^{-t^2} \, dt - \int_{-R-ix/2}^{R - ix/2}e^{-z^2} \, dz + i\int_{0}^{ -x/2}e^{-(R+iu)^2} \, du + i\int_{-x/2}^{0}e^{-(R+iu)^2} \, du,$$
and the contributions from the third and fourth integrals vanish as $R \to \infty$.
Thus,
$$-2f'(x) = -2\frac{d}{dx}e^{-x^2/4} \int_{-\infty}^{\infty}e^{-t^2}\, dt = xe^{-x^2/4} \int_{-\infty}^{\infty}e^{-t^2}\, dt = xf(x) $$
Consider $$ \int 2t e^{-t^2}\sin(xt)\,dt=-2e^{-t^2}\sin(xt)+x\int e^{-t^2}\cos(xt)\,dt $$ and the fact that $$ \lim_{t\to\infty}e^{-t^2}\sin(xt)=0 $$ (the same at $-\infty$).