This question arises as a follow-up to MSE2874264.
Let us assume to have $f\in L^2(-\pi,\pi)$ defined by
$$ f(x) = \sum_{n\geq 1} c_n \cos(nx) $$
where the coefficients $c_n$ are non-negative, decreasing to zero and such that $c_n=O\left(\frac{1}{n}\right)$.
Is it true that for any $a\in(1,+\infty)$ the quantity $ c_a \stackrel{\text{def}}{=}\frac{1}{\pi}\int_{-\pi}^{\pi}f(x)\cos(ax)\,dx $ belongs to the interval $\left[c_{\lfloor a\rfloor+1},c_{\lfloor a \rfloor}\right]$? In such a case, what conditions on $f$ ensure that $c_a$ is a decreasing function?
We may easily check that
$$ c_a = \sum_{n\geq 1}\frac{2a(-1)^n \sin(\pi a)}{\pi(a^2-n^2)}c_n $$
so if $a\in\mathbb{N}^+$ we have that $c_a$ agrees with the coefficient $c_{\lfloor a\rfloor}$ from the Fourier cosine series of $f$.
If that is not the case, an efficient strategy for bounding the previous series seems to invoke the Poisson summation formula and the fact that the Fourier transform of the $\operatorname{sinc}$ is well-known. Besides that I have not been able to produce sharp inequalities for $c_a$ in terms of $c_{\lfloor a\rfloor}$ and $c_{\lfloor a\rfloor+1}$ only.
The answer relies in Gibbs phenomenon. As pointed out in the comments below the main question it is not granted that if $a\in(n,n+1)$ then $c_a\in(c_{n+1},c_n)$, but due to the following lemma, the given constraints ensure that $c_a$ cannot lie too far from such interval: