Let $(X, \mathcal B, \mu)$ be a probability space, $f \in L^2 _\mu$.
Assume $|\langle f, \chi _B \rangle | \leq A \mu (B)$ for all $B \in \mathcal B$ and some $A \in \mathbb R$.
I want to prove that $\lVert f \rVert _\infty \leq A$.
This is just stated in a proof without justification, so it should be a one-liner.
We cannot choose $B$ to be the set of points where $f$ attains its essential supremum, as it can even be empty. How can we bound the inner product "from the correct direction"?
If we bound the inner product from the wrong direction we get $|\langle f, \chi _B \rangle | \leq \intop |f| \chi_B d\mu \leq \mu(B) \intop |f| d\mu $ Which is slightly suggestive for why the result makes sense.
Suppose $f\not\in L^\infty$. Then wlog $\forall n\in\Bbb N: \mu(B_n) = \mu(\{x\in X:f(x)\ge n\})> 0$. Now: $$A\mu(B_n)\ge\int_X f\chi_{B_n}\ge n\mu(B_n)\implies A\ge n.$$ For the inequality: suppose $\| f\|_\infty = A+\epsilon$, $\epsilon > 0$. Then, wlog $\mu(B) = \mu(\{x\in X:f(x)\ge A + \epsilon/2\})> 0$, and: $$A\mu(B)\ge\int_X f\chi_{B}\ge (A + \epsilon/2)\mu(B)\implies A\ge A + \epsilon/2,$$ contradiction.