The problem is that you are unsure on the identification between (some) functions and measures. Given a function $f\in L^1(\mathbb R^n)$, you can define a measure $\mu_f$ by
$$
\mu_f(A):=\int_{\mathbb R^n} f(x)\, dx, \quad \forall A\ \text{Lebesgue measurable},$$
or, more shortly, $d\mu_f := f\, dx$. The general theorem that governs this kind of constructions is the Radon-Nikodym theorem, but you do not need its full force, only the statement. If a measure $\mu_f$ is constructed like that, you say that it is absolutely continuous with respect to the Lebesgue measure $dx$, and you say that $f$ is the Radon-Nikodym derivative of $\mu_f$ with respect to $dx$, which alludes to the formal manipulation
$$
d\mu_f = f\, dx \quad \overset{\text{formal}}{\iff}\quad f=\frac{d\mu_f}{dx}.$$
Your question is now: can we do this construction with a function $f$ that does not belong to $L^1(\mathbb R^n)$? The answer is no: the writing
$$\tag{!!}
\int_A f\, dx $$
does not make sense for all measurable $A\subset \mathbb R^n$ unless $f\in L^1(\mathbb R^n)$.