Let $f$ be integrable over $R$ such that for any open set $U$: $\int_u fd\mu\leq b\mu(u)$. Then $f\leq b$ a.e Let $f$ be integrable over $R$ such that
for any open set $U$: $\int_U fd\mu\leq b\mu(U)$. Then $f\leq b$ a.e. ($b\in R$)
We also have the following result: If $f \in L^1$ and $\int_U f \geq 0$ for all open subsets $U$, then $f\geq 0$?
I want to use the result for $b-f$ but then I realised that $b-f$ need not be integrable over R.
Does anyone have any suggestions on how to proceed?
I also have an equivalent statement for $a\mu(u)\leq \int_u fd\mu$, $a\in R$
 A: I might have a possible solution:
Note: $b$ has to be positive if not $f$ would not be integrable.
Let $E=\{x\in X|f(x)>b\}=\cup\{x\in X|f(x)>b+\frac{1}{n}\}$. 
Suppose that $\mu(E)>0$. 
There exists $n$ s.t $\mu(E_n:=\{x\in X|f(x)>b+\frac{1}{n}\})>0$. 
Hence, we can find an open set $U_1$ s.t $\mu (U_1)<\mu(E_n)+\frac{1}{n_1}$ where $n_1$ is s.t $\frac{b}{n_1}<\frac{\mu(E_n)}{n}$ and $E_n\subseteq U_1$. 
Since $f$ is integrable on R, we have absolute continuity. 
Let $\epsilon$ s.t $\epsilon<\frac{\mu(E_n)}{n}-\frac{b}{n_1}$. 
Therefore, there exists $\delta$ s.t for all $\mu(A)<\delta$,$|\int_A fd\mu|<\epsilon$ 
Hence, we also have $E_n \subseteq U_2$ s.t $\mu(U_2- E_n)<\delta$
Now let $U=U_1\cap U_2$
Hence,$$b(\mu(E_n)+\frac{1}{n_1})\geq b\mu (U)\geq\int_Ufd\mu=\int_{E_n}fd\mu+\int_{U-E_n}fd\mu\geq (b+\frac{1}{n})\mu(E_n)-\epsilon$$ which implies that $$\frac{b}{n_1}\geq \frac{\mu(E_n)}{n}-\epsilon$$
Hence, contradiction.
For the equivalent statement with $a\in R$:
Since $f$ is integrable this implies $-f$ is integrable hence and $-\int fd\mu=\int -f d \mu$. Hence, for all open $U$ we have that $\int_U -f d \mu\leq -a\mu(U)$. Hence apply the above proof.
A: It is about regularity of Lebesgue measure. We assume the following
fact without proof: For any Lebesgue measurable set $A\subseteq\mathbb{R}$,
there exists a $G_{\delta}$-set (i.e., a countable intersection of
open sets) $B\subseteq\mathbb{R}$ such that $A\subseteq B$ and $\mu(B\setminus A)=0$.
For your case, let $A=\{x\in\mathbb{R}\mid f(x)>b\}$. We go to show
that $\mu(A)=0$ and it will follows that $f\leq b$ a.e.
Prove by contradiction. Suppose that $\mu(A)>0$. Observe that $A=\cup_{n=1}^{\infty}A_{n}$,
where $A_{n}=\{x\in\mathbb{R}\mid f(x)-b>\frac{1}{n}\}$, so there
exists $n_{0}$ such that $\mu(A_{n_{0}})>0$. Further observe that
$A_{n_{0}}=\cup_{n=1}^{\infty}\left(A_{n_{0}}\cap[-n,n]\right)$,
so there exists $n_{1}$ such that $\mu\left(A_{n_{0}}\cap[-n_{1},n_{1}]\right)>0$.
Denote $B=A_{n_{0}}\cap[-n_{1},n_{1}]$. Choose a sequence of open
sets $(U_{n})$ such that $B\subseteq\cap_{n}U_{n}$ and $\mu\left(\left(\cap_{n}U_{n}\right)\setminus B\right)=0$.
By replacing $U_{n}$ with $U_{1}\cap U_{2}\cap\ldots\cap U_{n}\cap(-n_{1}-1,n_{1}+1)$
if necessary, without loss of generality, we may assume that $(-n_{1}-1,n_{1}+1)\supseteq U_{1}\supseteq U_{2}\supseteq\ldots$.
Denote $G=\cap_{n}U_{n}$. Observe that $1_{U_{n}}(x)\rightarrow1_{G}(x)$
for each $x\in\mathbb{R}$ and hence $1_{U_{n}}(f-b)\rightarrow1_{G}(f-b)$
pointwisely. Observe that $|1_{U_{n}}(f-b)|\leq|1_{(-n_{1}-1,n_{1}+1)}(f-b)|$
which is integrable. By Dominated Convergence Theorem, we have 
\begin{eqnarray*}
\int_{G}(f-b)d\mu & = & \lim_{n}\int_{U_{n}}(f-b)d\mu\\
 & \leq & 0
\end{eqnarray*}
because $\int_{U}fd\mu\leq b\mu(U)$ for each open set $U$. On the
other hand, since $\mu(G\setminus B)=0$, we have 
\begin{eqnarray*}
\int_{G}(f-b)d\mu & = & \int_{B}(f-b)d\mu\\
 & \geq & \frac{1}{n_{0}}\mu(B)\\
 & > & 0.
\end{eqnarray*}
Hence, we obtain a contradiction.
