Calculus 10th Edition

Since $f(x)$ is the sum of functions that are continuous for all values of $x$, then by Theorem $1.11$, $f(x)$ is continuous for all values of $x.$ $f(0)=(0)^2-2-\cos{0}=-3\to f(0)\lt0.$ $f(\pi)=(\pi)^2-2-\cos{\pi}=\pi^2-1\to f(\pi)\gt0.$ Since $f(x)$ is continuous over the interval $[0, \pi]$ and the sign of $f(x)$ changes over the interval $[0, \pi]$, then the Intermediate Value Theorem guarantees at least one root in the interval.