# Proving $f$ is constant almost everywhere when $f$ is bounded and measurable on a positive-finite measurable subset $X\subset\mathbb{R}$

I've been looking everywhere for help (and I've haven't got very far as of yet [!]), and I unfortunately don't have much insight in terms of starting this proof. The problem-statement is given as followed:

Problem (Exact): Let $X$ be a measurable subset of $\mathbb{R}$, with finite, positive measure, $m(X)$. Let $f:X\rightarrow\mathbb{R}$ be bounded and measurable, such that $f$ obeys the relation ${\displaystyle{\bigg(\int_{X} ~f\bigg)^{2}=m(X)\int_{X}~f^{2}}}$. Prove that $f$ is almost everywhere constant.

I must apologize that I don't have much preliminary work, since I skipped over the problem and went onto working others. Any help, suggestions, recommendations, hints, tips, etc., will be GREATLY APPRECIATED! I recall that I kept getting stumped trying to bring the assumptions together to get somewhere close to a method to show $f$ is constant except on some zero set.

Also, I'm familiar with the (Lebesgue) measurability of $X$ given by either of the definitions $m^{*}(X)=\inf\big\{m(U):X\subset U,~U\text{ open}\big\}=m(X)=m_{*}(X)=\sup\big\{m(V):V\subset X,~V\text{ closed}\big\}$; or, e.g., $m^{*}(X)=\inf\bigg\{{\displaystyle{\sum\limits_{k=1}^{+\infty}|I_{k}|:X\subset\bigcup\limits_{k=1}^{+\infty}I_{k},~I_{k}\subset\mathbb{R}\text{ is open},~k\in\mathbb{N}}}\bigg\}$ and/or $X$ is measurable if for any test set $E\subset\mathbb{R}$ we have $m^{*}(E)=m^{*}(E\cap X)+m^{*}(E\cap X^{c})$.

• This is related to the probability fact that for a random variable $X$ we have $Var(X)=E[X^2]-E[X]^2$. You might define $z=\frac{\int_X f}{m(X)}$ and then compute $\int_X (f-z)^2$. – Michael Mar 25 '16 at 18:48
• @Michael I'll give it a shot, and thank you for the advice! I have to unfortunately admit that I have very little experience with probability. But, from what I'm gathering (if I'm correct) - the random variable statement is used to start off with, then computing the integral and coupling the result with the random variable statement is the overall way to go? – Procore Mar 25 '16 at 18:55
• You don't need to use probability. But, a finite measure space can be converted to a probability measure simply by normalizing everything by dividing by the measure of the whole space, which is the inspiration for dividing by $m(X)$ in my comment above. – Michael Mar 25 '16 at 18:58
• @Michael: I see what you mean (thanks again)...I'll see what I can come up with - your comment alone provides more help than hours of time I've spent pondering how to start the proof as well as checking online for help afterwards - I usually post question here as kind of a last resort in general. – Procore Mar 25 '16 at 19:01

Basically this is just the "converse" of Schwarz's inequality. One has $$\left(\int_X f\right)^2=\left(\int_X 1\cdot f\right)^2\leq \int_X 1^2\cdot \int_X f^2 =m(X)\cdot\int_X f^2$$ with equality sign at $\ \leq\$ iff there is a $\lambda\in{\mathbb R}$ such that $\ f(x)=\lambda \>1(x)\equiv\lambda$ almost everywhere on $X$ with respect to $m$.
• I follow this completely! I'm still new to Lebesgue and measure theory. I have to remember that the set of measurable functions from $\mathbb{R}$ to $\mathbb{R}$ is a vector space (integrable functions a subspace of this $\mathbb{R}$-vector space)!!! Thank you Christian. – Procore Mar 25 '16 at 19:21