Condition to have an almost everywhere property Let $T>0$ and $g\in L^1([0,T])$ a non-negative function. Suppose that for all continuous and non-negative functions $f:[0,T]\rightarrow \mathbb R$ we have
$$\int_0^Tf(t)g(t)dt \leq \int_0^Tf(t)dt.$$
Do we have that $g(t)\leq 1$ for almost all $t\in[0, T]$?
I know that if the same property is verified for all $f$ measurable, then we have the result, but it's not the case...
 A: What you would like to do is simply take $$f=1_{g>1},$$ but this function is usually not continuous. However, it is measurable and bounded and hence integrable over $[0,T]$, so you can approximate it with a sequence $(f_n)$ of continuous functions, since $C([0,T])$ is dense in $L^1([0,T])$ with respect to the $L^1$-norm. You can then check that
$$ \bar f_n(x):= \min\{\max\{f_n(x),0\},1\}, \quad x\in[0,T],$$
defines a non-negative continuous function for all $n \in \Bbb N$ and the sequence $(\bar f_n)$ also converges to $f$ with respect to the $L^1$-norm. Without loss of generality, we can assume that it also converges almost everywhere (since any $L^1$-convergent sequence has an almost everywhere convergent subsequence). Now
$$ |\bar f_n(1-g)|\le 1+|g| $$
and dominated convergence yields
$$0\ge\int_0^T 1_{g(t)>1}(1-g(t))dt=\int_0^T f(t)(1-g(t))dt=\lim \int_0^T \bar f_n(t)(1-g(t))dt \ge 0.$$
Hence, the non-positive function $1_{g(t)>1}(1-g(t))$ must vanish almost everywhere. This is only possible, if $g\le 1$ almost everywhere.
PS: Even if for whatever reason we could not take a subsequence, this would not be a problem, since $L^1$ convergence implies convergence in measure by Markov's Inequality, and the Dominated Convergence Theorem actually works for convergence in measure. Apart from simplicity, the only reason that it is more commonly stated with convergence almost everywhere is that this version holds for any measure, while convergence in measure is only meaningful for $\sigma$-finite measures. But now I really start to digress...
