I have the following problem:
Let $G \subset \mathbb{R}^n$ open. Show that $f \in L_{loc}^1(G) \Leftrightarrow \forall x \in G\; \exists $ neighborhood $U_x$ of $x$ with $U_x \subset G$ s.t. $f|_{U_x} \in L_{loc}^1(U_x)$.
My solution is:
"$\Rightarrow$" Let be $x \in G$, then $\exists K$ compact s.t. $x \in K\setminus\partial{K}$. Choose $\epsilon > 0$ s.t. $\epsilon < \text{dist}(x,\partial{K})$. Define then $U_x := \{\text{all point separated from } \partial{K} \text{ by a distance greater than } \epsilon \}$. Then $U_x$ is open and is a neighborhood of $x$. We then have $f|_K \in L_{loc}^1(K) \overset{U_x \subset K}{\Rightarrow} L_{loc}^1(U_x)$ .
"$\Leftarrow$" Let be $K$ compact and $\{x_i\}_{i\in \mathbb{N}} \subset K$ a sequence s.t. $\forall x_i\; \exists\; U_{x_i}$ s.t. $f|_{U_{x_i}} \in L_{loc}^1(U_{x_i})$ and $\cup_{x_i} U_{x_i} \supset K$. Then as $\forall x_i,\;f \in L_{loc}^1(U_{x_i}) \Rightarrow f \in L_{loc}^1(\cup_{x_i} U_{x_i}) \Rightarrow L_{loc}^1(K).$ $\Box$
I just want to know if I'm right.