I want to find a linear combination of $\cos nx$, $n\ge 0$ (so it's an even trigonometric polynomial) with integer coefficients having small absolute values in a given range. To be specific, I want to find $a_0,a_1,\cdots,a_m \in \mathbb{Z}$ (not all of them zero) such that $f(x)=a_0+a_1 \cos x + \cdots + a_m \cos mx$ satisfies $|f(x)|<1$ for all $x\in I$, where an interval (or a finite union of intervals) $I$ is given.
Because of the symmetry, WLOG we can assume that $I \subset [0,\pi]$. For example, $f(x)=1+2\cos x + 2\cos 2x - 2\cos 4x - 2\cos 5x$ satisfies $|f(x)|<1$ for $x \in [2,\pi]$. It will be helpful for me if one can find such $f$ for "longer" $I$.
(EDIT: I'd like to exclude the simplest cases, monomials $\cos mx$.)