Let $$I(\beta) =\int_{0}^{\infty} x e^{-x} \cos (x) \cos( \beta x^{2}) \, \mathrm dx \, , \quad \beta>0. $$
Let's take the Laplace transform of $I (\beta)$ and then switch the order of integration (which is permissible since the iterated integral converges absolutely).
$$ \begin{align}\mathcal{L} \{I(\beta)\} (s) &= \int_{0}^{\infty} \left(\int_{0}^{\infty} x e^{-x} \cos(x) \cos(\beta x^{2}) \, \mathrm dx \right)e^{-s \beta } \, \mathrm d \beta \\ &= \int_{0}^{\infty} x e^{-x} \cos(x) \int_{0}^{\infty}\cos(\beta x^{2}) e^{- s \beta } \, \mathrm d \beta \, \mathrm dx \\ &= s \int_{0}^{\infty} \frac{x e^{-x}\cos (x)}{x^{4}+s^{2}} \, \mathrm dx \tag{1} \end{align} $$
To evaluate $(1)$, we can integrate the complex function $$f(z) = \frac{z e^{-z}e^{iz}}{z^{4}+s^{2}} $$ around a wedge-shaped contour that makes an angle of $\frac{\pi}{2}$ with the positive real axis (i.e., a closed quarter-circle in the first quadrant of the complex plane).
In the first quadrant of the complex plane, $\vert e^{-z} \vert \le 1$ and $\vert e^{iz} \vert \le 1$. So the integral along the big arc clearly vanishes as the radius of the arc goes to $\infty$.
Integrating around the contour, we get $$ \begin{align} \int_{0}^{\infty} \frac{x e^{-x} e^{ix}}{x^{4}+s^{2}} \, \mathrm dx + \int_{\infty}^{0} \frac{(it)e^{-it} e^{-t}}{t^{4}+s^{2}} \, i \, \mathrm dt &= 2 \pi i \operatorname{Res} \left[f(z), e^{i \pi/4} \sqrt{s} \right] \\ &= 2 \pi i \lim_{z \to e^{i \pi/4} \sqrt{s}}\frac{ze^{-z}e^{iz}}{4z^{3}} \\ &= 2 \pi i \, \frac{e^{i \pi/4}\sqrt{s} \, e^{-\sqrt{2s}} }{4e^{3 \pi i/4}s^{3/2}} \\ &= \pi \, \frac{e^{-\sqrt{2s}}}{2s}. \end{align}$$
And if we equate the real parts on both sides of the equation, we get $$2 \int_{0}^{\infty} \frac{xe^{-x} \cos(x) }{x^{4}+s^{2} } \, \mathrm dx = \pi \, \frac{e^{-\sqrt{2s}}}{2s}.$$
Therefore, $$\mathcal{L} \{I(\beta)\} (s) = \frac{\pi e^{-\sqrt{2s}}}{4}. $$
Due to the uniqueness of the inverse Laplace transform , we only need to show that $$\mathcal{L} \left\{\frac{\sqrt{2 \pi}}{8} \beta^{-3/2} e^{-1/(2 \beta)} \right\} (s) = \frac{\pi e^{-\sqrt{2s}}}{4}$$ in order to prove that $$I(\beta) = \frac{\sqrt{2 \pi}}{8} \beta^{-3/2} e^{-1/(2 \beta)}.$$
From the answers here, we know that for $a,b>0$, $$\int_{0}^{\infty} \frac{\exp \left(-ax^{2}-b/x^{2}\right)}{x^{2}} \, \mathrm dx = - \frac{1}{2} \sqrt{\frac{\pi}{a}} \, \frac{\partial }{\partial b} e^{-2\sqrt{ab}} = \frac{1}{2} \sqrt{\frac{\pi}{b}} \, e^{-2\sqrt{ab}}.$$
(Differentiation under the integral sign is permissible since for any positive $c$ less than $b$, $\frac{\exp \left(-ax^{2}-b/x^{2}\right)}{x^{2}}$ is dominated by the integrable function $ \frac{\exp \left(-ax^{2}-c/x^{2}\right)}{x^{2}}$.)
Therefore, $$\begin{align} \mathcal{L} \left\{\frac{\sqrt{2 \pi}}{8} \beta^{-3/2} e^{-1/(2 \beta)} \right\} (s) &= \frac{\sqrt{2 \pi}}{8} \int_{0}^{\infty}\beta^{-3/2} e^{-1/(2 \beta)} e^{-s \beta } \, \mathrm d \beta \\ &= \frac{\sqrt{2 \pi}}{4} \int_{0}^{\infty} \frac{\exp \left(-s u^{2} - (1/2)/u^{2} \right)}{u^{2}} \mathrm du \\ &= \frac{\sqrt{2 \pi}}{4} \frac{\sqrt{2 \pi}}{2} \, e^{-\sqrt{2s}} \\ &= \frac{ \pi \, e^{-\sqrt{2s}}}{4}. \end{align}$$