# bounded measurable function

I'm looking at my old review questions from my real analysis notes from years ago, and see this problem:

Let $g$ be an integrable function. on $[0,1]$. Is there a bounded measurable function $f$ such that $$\int_{[0,1]} fg = \lVert g\rVert _1 \cdot \lVert f\rVert _{\infty}.$$

I don't know how to go about this problem, but I dug up my old notes and it seems that I have to use Riesz Representation Theorem to show the affirmative. How right or wrong am I with my hunch?

-

Yes: take $$f(x):=1\cdot \chi_{S^+}(x)-1\cdot\chi_{S^-}(x),$$ where $S^+:=\{x,g(x)>0\}$ and $S^-:=\{x,g(x)<0\}$.