I want to prove the following statement:
$f(t)$ $T-$periodic and differentiable veryfiyng that $f(t)\geq 0 \implies f'(t)$ has constant sign (i.e $f'(t)\leq 0\, \forall t\in [O,T]$ or $f'(t)\geq 0\, \forall t\in [O,T]$), then $f(t)$ has constant sign.
My attempt:
Suppose first that $f(0)=f(T)<0$ and that it changes of signt, i.e $\exists c\in [0,T]$ with $f(c)>0$. By Bolzano's Theorem $\exists a\in [0,c]$ and $\exists b\in [c,T]$ such as $f(a)=f(b)=0$ and $f([a,b])\geq 0$. So, $f'([a,b])$ has constant sign and, therefore,
Or $f'([a,b])\geq0$ and $0=f(a)\leq f(x)\leq f(b)=0$, $\forall x\in[a,b]$ and as a consequence $f([a,b])=0$.
Or $f'([a,b])\leq 0$ so $0=f(a)\geq f(x)\geq f(b)=0$, $\forall x\in[a,b]$ and as a consequence $f([a,b])=0$.
So $f(c)=0$ contradiction !! and we get that $f(t)\leq 0$, $\forall t\in[0,T]$.
Suppose now that $f(0)=f(T)\geq 0$. If $f(t)$ does not vanish in $[0,T]$ then $f(0)\leq f(x) \leq f(T)$ or $f(0)\geq f(x) \geq f(T)$, $\forall x\in [0,T]$. Therfore, $f(t)\equiv f(0)\geq 0$.
EDIT
Suppose now that $f(0)=f(T)\geq 0$. If $f(t)$ vanishs in $[0,T]$. Let $c\in[0,T]$ be the first time it vanishes and $\tilde{c}\in[0,T]$ the last one ($c\leq\tilde{c}$). Then, $f([0,c])\geq 0$ and $f([\tilde{c},T])\geq 0$. By the MVT: $$\frac{f(c)-f(0)}{c-0}=\frac{-f(0)}{c}=f'(c^*)$$ for $c^*\in [0,c]$ and, $$\frac{f(T)-f(\tilde{c})}{T-\tilde{c}}\stackrel{f(T)=f(0)}{=}\frac{f(0)}{T-\tilde{c}}=f'(\tilde{c}^*)$$ for $\tilde{c}^*\in [\tilde{c},T]$. Thus, $$\frac{f(0)}{T-\tilde{c}^*}\frac{-f(0)}{c}=f'(\tilde{c}^*)f'(c^*)\leq 0,$$ contradicting that $f'$ has constant signe if $f(t)\geq 0$.