This question is motivated by the earlier MO question: [Show that $(\sum\_{k=1}^{n}x\_{k}\cos{k})^2+(\sum\_{k=1}^{n}x\_{k}\sin{k})^2\le (2+\frac{n}{4})\sum\_{k=1}^{n}x^2\_{k}$](https://mathoverflow.net/questions/354383/show-that-sum-k-1nx-k-cosk2-sum-k-1nx-k-sink2-le-2) .
It is a cleaned up asymptotic version of that question. 


Let $f$ be a non-negative function, periodic with period $1$, and square integrable on ${\Bbb R}/{\Bbb Z}$. Is it true that 
$$ 
|{\widehat f}(1)|^2 = \Big| \int\_0^1 f(x) e^{-2\pi ix} dx \Big|^2 \le \frac 14 \int\_0^1 f(x)^2 dx \ \ ? 
$$
Equality is attained for example when $f(x) = \max(0, \cos(2\pi x))$. 


Note that $|\widehat f(1)| =|\widehat f(-1)|$ and, since $f$ is non-negative, $|\widehat f(1)| \le \widehat f(0)$. Therefore 
$$
\int\_0^1 f(x)^2 dx = \sum\_n |\widehat f(n)|^2 \ge 3 |\widehat f(1)|^2,
$$ 
so that the estimate holds with $1/3$ in place of $1/4$. There is a lot of scope to improve this argument, and with a more careful application of Bessel's inequality I could get the constant $1/4+1/4\pi$. But the claimed inequality looks very clean, and I wonder if (i) it is true!, (ii) is known in some context, and (iii) (hopefully) has an elegant proof?



Bounding a Fourier coefficient of a non-negative periodic function in terms of its $L^2$-norm
Your conjecture is indeed correct. The proof is based on the following simple yet powerful trick I learned many years ago: $|z| = \sup\_{|v| = 1} \Re (zv)$. Therefore it is enough to only bound from above $\Re \left(\int\_0^1 vf(x)e^{-2\pi ix}dx\right)$ for all $v\in \mathbb{T}$. And now it is clear by Cauchy-Schwarz that $f$ should be proportional to $\max(0, \Re(ve^{-2\pi ix}))$, and all such functions gives us $\frac{1}{4}$ ($f$ from the OP corresponds to the choice $v = 1$).


