Prove that $f(a)=f(b)$ if $\int_{-\infty}^{\infty}f(x)dx=1$ Task is: 
$f(x)$ is positive, continious function in the field of real numbers, and $\int_{-\infty}^{\infty}f(x)dx=1$. Let $\alpha\in(0,1)$, and length of $[a,b]$ is minimal from all $\int_{a}^{b}f(x)dx=\alpha$. Prove that $f(a)=f(b)$
I've tried to use mean value theorem.
And I've tried to use some knowledge from probability theory, because $f(x)$ is seems like probability density function.
But for now, I haven't came any closer to proof.
 A: The trick is reframing it in language that is familiar to optimization.
Let $g(a,b) = b - a$. We want to minimize $g$ subject to the constraint $h(a,b) = \int_a^b f(t) \ dt = \alpha$ for some $\alpha \in (0,1)$. 
Note that the constraint isn't vacuous because $\int_{\mathbb R}f = 1 $ implies there must be at least one pair $(a,b)$ which satisfies $h(a,b) = \alpha$.
Using now Lagrange multipliers, $\nabla g - \lambda \nabla h = 0$ iff
$$-1 + \lambda \frac{\partial h}{\partial a} = 0 \ \ \ \text{ and } \ \ \  1 + \lambda \frac{\partial h}{\partial b} = 0$$
Apply the Fundamental Theorem of Calculus and you're done.

This is a nice result. I tried at first to construct a counterexample. 
Intuitively, I think I've convinced myself it makes sense: on the optimizing interval $[a,b]$, there is some value of $x \in (a,b)$ for which $f(x) > \max\left( f(a), f(b) \right)$. Now look at alternative scenario intervals $J= [a\pm\delta_1, b\pm\delta_2]$, which maintain $\int_J f = \alpha$. If $f(a) \neq f(b)$ it looks like we can make $J$ shorter than $b - a$.
If anyone can turn that into a formal argument it would be interesting to see.
A: Making precise the intuition that has been suggested by Simon S.
Assume that $f(b)>f(a)$. Then from continuity of $f$ we can find a $\delta$ such that
$f(x_1)< f(x_2) $ $\forall x_1 \in [a,a+\delta],\,\forall x_2 \in [b,b+\delta]$. The previous implies that $\int _a^{a+\delta} f(x)d x<\int _b^{b+\delta} f(x)d x\fbox{1}$.
Now define the continuous function $F(x)=\int _{a+\delta}^x f(x)d x$.
Then since $f$ is always positive $F(b)=\int _{a+\delta}^b f(x)d x<\alpha$. Then again from $\fbox{1}$ we see that 
$F(b+\delta)=\int _{a+\delta}^{b+\delta} f(x)d x=\int _{a}^{b} f(x)d x+ \int _b^{b+\delta}f(x)d x-  \int _a^{a+\delta} f(x)d x>\alpha$. Hence from continuity of $F$ there is a $c<\delta$ such that $F(b+c)=a$. 
But $b+c-a-\delta<b-a$ a contradiction.
