Let $f$ be the function defined as
$$f(x)=\begin{cases}\cos(x)&, x<0\\\\x^2&,x>0
\end{cases}$$
Then, for $\phi\in \mathbb{S}$, we have
$$\begin{align}
\langle \mathscr{F}\{f\},\phi\rangle&=\langle f,\mathscr{F}\{\phi\}\rangle\\\\
&=\int_{-\infty}^0 \cos(x)\int_{-\infty}^\infty \phi(k)e^{ikx}\,dk\,dx+\int_0^{\infty} x^2\int_{-\infty}^\infty \phi(k)e^{ikx}\,dk\,dx \\\\
&=-\lim_{L\to\infty}\int_0^L \cos(x)\int_{-\infty}^\infty \phi(k)e^{-ikx}\,dk\,dx\\\\
&+\lim_{M\to \infty}\int_0^M x^2\int_{-\infty}^\infty \phi(k)e^{ikx}\,dk\,dx\\\\
&=-\lim_{L\to\infty}\int_0^L \cos(x)\int_{-\infty}^\infty \phi(k)e^{-ikx}\,dk\,dx\tag{1a}\\\\
&-\lim_{M\to \infty}\int_0^M \int_{-\infty}^\infty \phi''(k)e^{ikx}\,dk\,dx\tag{1b}
\end{align}$$
where we used the fact that $x^2e^{ikx}=-\frac{d^2e^{ikx}}{dk^2}$ and then integrated twice by parts to arive at $(1b)$. Next, we will apply the Fubini-Tonelli Theorem.
Inasmuch as $\phi\in \mathbb{S}$, the Fubini-Tonelli theorem guarantees that we can interchange the order of integration in $(1a)$ and $(1b)$. Proceeding we find that
$$\begin{align}
\int_0^L \cos(x)\int_{-\infty}^\infty \phi(k)e^{-ikx}\,dk\,dx&=\frac i2\int_{-\infty}^\infty \phi(k) \left(\frac{e^{-i(k+1)L}-1}{k+1}+\frac{e^{-i(k-1)L}-1}{k-1}\right)\,dk\\\\
&=\frac12 \int_{-\infty}^\infty \phi(k) \left(\frac{\sin((k+1)L)}{k+1}+\frac{\sin((k-1)L)}{k+1}\right)\,dk\tag{2a}\\\\
&+\frac i2 \int_{-\infty}^\infty \phi(k)\left(\frac{\cos((k+1)L)-1}{k+1}+\frac{\cos((k-1)L)-1}{k-1}\right)\,dk \tag{2b}
\end{align}$$
and
$$\begin{align}
\int_0^M \int_{-\infty}^\infty \phi''(k)e^{ikx}\,dk\,dx&= \int_{-\infty}^\infty \phi''(k)\frac{e^{ikM}-1}{ik}\,dk\\\\
&=\int_{-\infty}^\infty \phi''(k)\frac{\sin(kM)}{k}\,dk\tag{3a}\\\\
&-i\int_{-\infty}^\infty \phi''(k)\frac{\cos(kM)-1}{k}\,dk\tag{3b}
\end{align}$$
Using the result in THIS ANSWER or THIS ONE, we let $L\to \infty$ in $(2a)$ and $M\to\infty$ in $(3a)$ to reveal
$$\lim_{L\to\infty}\frac12 \int_{-\infty}^\infty \phi(k) \left(\frac{\sin((k+1)L)}{k+1}+\frac{\sin((k-1)L)}{k+1}\right)\,dk=\frac\pi2 \left(\phi(-1)+\phi(1)\right)$$
and
$$\lim_{M\to\infty}\int_{-\infty}^\infty \phi''(k)\frac{\sin(kM)}{k}\,dk=\pi\phi''(0)$$
$$$$
Finally, to evaluate the remaining limits we use the following analysis. Note that
$$\begin{align}
\lim_{M\to\infty}\int_{-\infty}^\infty \phi(k)\frac{\cos(kM)-1}{k}\,dk&=\lim_{M\to\infty}\text{PV}\int_{-\infty}^\infty \phi(k)\frac{\cos(kM)}{k}\,dk\\\\
&-\text{PV}\int_{-\infty}^\infty \frac{\phi(k)}{k}\,dk\\\\
&=\lim_{M\to\infty}\text{PV}\int_{|k|<1} \phi(k)\frac{\cos(kM)}{k}\,dk\\\\
&+\lim_{M\to\infty}\text{PV}\int_{|k|>1} \phi(k)\frac{\cos(kM)}{k}\,dk\\\\
&-\text{PV}\int_{-\infty}^\infty \frac{\phi(k)}{k}\,dk\\\\
&=\underbrace{\lim_{M\to\infty}\int_{|k|<1} (\phi(k)-\phi(0))\frac{\cos(kM)}{k}\,dk}_{=0\,\,\text{using the Riemann-Lebesgue Lemma}}\\\\
&+\phi(0)\lim_{M\to\infty}\underbrace{\text{PV}\int_{|k|<1} \frac{\cos(kM)}{k}\,dk}_{=0\,\,\text{since the integrand is odd}}\\\\
&+\underbrace{\lim_{M\to\infty}\text{PV}\int_{|k|>1} \phi(k)\frac{\cos(kM)}{k}\,dk}_{=0\,\,\text{using the Riemann-Lebesgue Lemma}}\\\\
&-\text{PV}\int_{-\infty}^\infty \frac{\phi(k)}{k}\,dk\\\\
&=-\text{PV}\int_{-\infty}^\infty \frac{\phi(k)}{k}\,dk
\end{align}$$
Putting it all together, we find that in distribution
$$\mathscr{F}\{f\}=i\text{PV}\left(\frac{2k}{k^2-1}\right)+\frac{\pi}2 \left(\delta(k+1)+\delta(k-1)\right)-\pi \delta''(k)- i \left(\frac2{k^3}\right)_D$$
where $\left(\frac{2}{k^3}\right)_D$ is the distributional derivative of $\text{PV}\left(\frac1k\right)$