Assume ${\bf x} \in \mathbb{R}^n$ denotes a real-valued bounded random variable with a distribution measured on the Borel space $(\mathbb{R}^n,\mathcal{B}^n)$. Let $f:\mathbb{R}^n\to\mathbb{R}$ denote a bounded Borel measureable function. Then, the following expectation value for any Borel set $B$


$$
E[f({\bf x}){\bf 1}\_{{\bf x}\in B}] = \int\_B f({\bf x}) dP
$$


is bounded. 


Is there any reason that the $\sup\_{B\in\mathcal{B}^n} E[f({\bf x}){\bf 1}\_{{\bf x}\in B}]$ occurs at a certain Borel set $B$ or could there just be convergence towards the supremum?



Maximum of bounded expectations at a certain Borel set?
Yes, it's attained. Note that the desired expression can be written as $E[(f 1\_B)(\mathbf{x})]$. Then it's clear that we get the maximum by taking $B = \{f \ge 0\}$, so that $f 1\_B = f^+$, the positive part of $f$. Indeed, if $A$ is any other Borel set, then $E[(f 1\_A)(\mathbf{x})] = E[(f^+ 1\_A)(\mathbf{x})] - E[(f^- 1\_A)(\mathbf{x})]$. But $f^+ 1\_A \le f^+$ and $f^- 1\_A \ge 0$.




---


Previous overly sophisticated argument, please ignore:


Let $\nu(B) = E[f({\bf x}){\bf 1}\_{{\bf x}\in B}] = \int\_B f({\bf x}) dP$; then $\nu$ is a signed measure on $\mathbb{R}^n$. The [Hahn decomposition theorem](https://en.wikipedia.org/wiki/Hahn_decomposition_theorem) guarantees that we can partition $\mathbb{R}^n = B\_+ \cup B\_-$, with $B\_+, B\_-$ Borel, such that $\nu(A) \ge 0$ for all Borel $A \subset B\_+$ and $\nu(A) \le 0$ for all Borel $A \subset B\_-$. In particular, if $B$ is any other Borel set, we have $\nu(B) = \nu(B\_+) - \nu(B\_+ \setminus B) + \nu(B \cap B\_-)$. But $\nu(B\_+ \setminus B) \ge 0$ by the theorem, and $\nu(B \cap B\_-) \le 0$, so $\nu(B) \le \nu(B\_+)$. Thus the maximum is attained at $B\_+$.


