Let $G$ be a abelian, locally compact group with a Haar measure $dx$ on $G$. We know that every Haar measure is inner regular, ie... for any open subset $U$ of $G$, then $dx(U)=\sup\{dx(F):\;F\;\;\text{is compact and is a subset of}\;\;U\}$.Here we denote $dx(F)$ is the measure of $F$ respect to $dx$.
Now we are given a non-negative function $u:G\to\mathbb R$, an open subset $U$ of $G$ such that $u\in L^1_{loc}(G)$. We assume that, there is a constant $c>0$ so that $\int_F u(y)dy\leq c<\infty$ for any $F$ is compact and is a subset of $U$.
Is it true that $\int\limits_Uu(y)dy=\sup\limits_F\;\int\limits_F u(y)dy$, where supremum is taken over all compact $F$ which is a subset in $U$? Could you give me some ideas to prove if it is true.
The following steps lead to a solution if $U$ has compact closure:
(1) Firstly, prove that $\int_F u(y)dy\leq \int_U u(y)dy$ for all compact $F\subseteq U$. (Hint: $u:G\to\mathbb{R}$ is $\textit{nonnegative}$.)
(2) Secondly, we wish to prove that for each $\epsilon>0$, there is a compact $F\subseteq U$ such that $\int_U u(y)dy - \int_F u(y)dy<\epsilon$. Note that $\int_U u(y)dy -\int_F u(y)dy = \int_{U\setminus F} u(y)dy$.
(3) Since $u\in L_{\text{loc}}^1(G)$, $u\in L^1(\overline{U})$ where $\overline{U}$ denotes the closure of $U$. (We have used the assumption that $U$ has compact closure.)
(4) Prove the following general fact in measure theory: if $(X,\mu)$ is a measure space and if $f\in L^1(X)$, then to each $\epsilon>0$, there exists a $\delta>0$ such that whenever $\mu(E)<\delta$, then $\int_{E} \left|f\right|<\epsilon$.
(5) If $\epsilon>0$, apply the inner regularity of the Haar measure $dx$ to conclude the existence of a compact $F\subseteq U$ such that the measure of $U\setminus F$ is $<\delta$ where $\delta$ is as in (4) (with $u$ in place of $f$ and $\overline{U}$ in place of $X$). Conclude the result from (2).
I hope this helps!