Let $f$ be continuously differentiable on $[a,b]$, and $f(a)=f(b)=0, \int_a^b f(x)dx=0$ implies $\int_a^b f^2(t)dt\leq (\frac{b-a}{2\pi})^2 \int_a^b |f'(x)|^2dx$
The problem is how to let $\pi$ appears. It is not easy to find a $C>0$ such that $\int_a^b f^2(t)dt\leq C \int_a^b |f'(x)|^2dx$, but $(\frac{b-a}{2\pi})^2$ ...
I don't think the condition $f(a)=f(b)=0$ is necessary. I only assume that $f(a)=f(b)$ and $\int_a^bf(x)dx=0$. By rescaling, I can further take $a$ and $b$ to be $0$ and $2\pi$ so that the inequality to be proved is $$\int_0^{2\pi}\big|f(t)\big|^2dt\leq \int_0^{2\pi}\big|f'(t)\big|^2dt.$$
Let $$f(t)=\sum_{k=1}^\infty \big(A_k\cos(kt)+B_k\sin(kt)\big)$$ be the Fourier series of $f$ (the constant term is $0$ because of the assumption $\int_0^{2\pi}f(t)dt=0$). Since $f$ is continuously differentiable $$f'(t)=\sum_{k=1}^\infty k\big(-A_k\sin(kt)+B_k\cos(kt)\big).$$ This shows that $$\int_0^{2\pi}\big|f(t)\big|^2dt=\pi\sum_{k=1}^\infty \big(|A_k|^2+|B_k|^2\big)$$ and $$\int_0^{2\pi}\big|f'(t)\big|^2dt=\pi\sum_{k=1}^\infty k^2\big(|A_k|^2+|B_k|^2\big)$$ by Parseval's identity. This proves that $$\int_0^{2\pi}\big|f'(t)\big|^2dt-\int_0^{2\pi}\big|f(t)\big|^2dt=\pi\sum_{k=1}^\infty(k^2-1)\big(|A_k|^2+|B_k|^2\big)\geq 0.$$ The equality holds iff $f(t)=A\cos(t)+B\sin(t)$ for some constants $A,B$.