I've been thinking for several hours now, and can't see it.

Let $\displaystyle ([0,1],\mathcal{M},\mathbb{P})$ be a probability space. Let $\displaystyle f:[0,1]\rightarrow\mathbb{R}$ be a $\displaystyle \mathbb{P}$-integrable variable (in the Lebesgue sense). Then the following conditions are equivalent:

- $\displaystyle f$ is $\displaystyle \mathbb{P}$-almost everywhere constant

- $\displaystyle e^{\int_{[0,1]}f(x)\mathrm{d}\mathbb{P}}=\int_{[0,1]}e^{f(x)}\mathrm{d}\mathbb{P}$

Obviously I must be missing some inequality, probably well known. Any help will be appreciated.