Answer
$$f''(x)=x^{\cos(x)} \left[\frac{\cos(x)}{x}-\sin(x)\ln (x)\right]$$
Work Step by Step
Given
$$f(x)= x^{\cos(x)}$$
Take $\ln $ for both sides
\begin{aligned}
\ln f(x)&= \ln x^{\cos (x)}\\
&=\cos (x)\ln (x)
\end{aligned}
Differentiate both sides
\begin{aligned}
\frac{f'(x)}{f(x)}&= \cos(x) \frac{1}{x} + \ln (x) (-\sin(x))\\
f'(x)&= f(x) \left[\frac{\cos(x)}{x}-\sin(x)\ln (x)\right]\\
&=x^{\cos(x)} \left[\frac{\cos(x)}{x}-\sin(x)\ln (x)\right]
\end{aligned}
we can note that $f(x)$ is increasing when $f'(x)>0 $ and $f(x)$ is decreasing when $f'(x)<0 $