Let $f\in C^1([0,\pi],\mathbb R)$ such that $\displaystyle\int_0^\pi f(t) dt=0$
Prove that $\forall x\in [0,\pi],\displaystyle|f(x)|\leq \sqrt{\frac{\pi}{3}\int_0^\pi f'^2(t)dt}$
Failed natural attempt
$\int_0^\pi f(t) dt=0$ tells us that there is some $\beta\in [0,1]$ such that $f(\beta)=0$
Using the fundamental theorem of calculus and Cauchy-Schwarz inequality,
$\displaystyle |f(x)|=|f(x)-f(\beta)|\leq\int_x^\beta |f'(t)|dt\leq \int_0^\pi |f'(t)|dt \leq \sqrt{\pi} \sqrt{\int_0^\pi f'^2}$
It is not sharp enough.
This might have something to do with Fourier series.
Without Fourier series: we have $((t-a)f(t))'=(t-a)f'(t)+f(t)$. Hence $$ \int_0^t\tau f'(\tau)d\tau=tf(t)-\int_0^tf(\tau)d\tau,\qquad \int_t^\pi(\tau-\pi)f'(\tau)d\tau=(\pi-t)f(t)-\int_t^\pi f(\tau)d\tau. $$ By adding these, we obtain $$ \pi f(t)=\int_0^\pi g(\tau)f'(\tau)d\tau,\qquad g(\tau)=\begin{cases}\tau,&\tau<t,\\\tau-\pi,&\tau>t.\end{cases} $$ Now, by Cauchy-Schwarz, $$ \pi |f(t)|\le \sqrt{\int_0^\pi |f'(\tau)|^2d\tau}\sqrt{\frac{t^3}3+\frac{(\pi-t)^3}3}\le \sqrt{\int_0^\pi |f'(\tau)|^2d\tau}\sqrt{\frac{\pi^3}{3}} $$ Dividing by $\pi$, we obtain the desired result. QED
How to guess this proof? It is easy enough: $\frac13$ can only come from $\int t^2 dt$ in this context, so (having in mind Cauchy--Schwarz) we need to estimate $f$ somehow via the integral of $tf'(t)$.