I am trying to understand induced measures in the context of expectation. I have commonly seen formulas such as KL-divergence written like so:
$$\text{KL}(p||q) = \int\log\dfrac{p(x)}{q(x)}dp = \int p(x) \log\dfrac{p(x)}{q(x)}dx = \mathbb{E}_{p(x)}[\log\dfrac{p(x)}{q(x)}]$$
which reads as the expectation of the formula $\log\dfrac{p(x)}{q(x)}$ with respect to the measure $p(x)$. But over what set is this measure being taken?
Is it over the entire real line: $\int_{-\infty}^\infty p(x) \log\dfrac{p(x)}{q(x)}dx$?
Or is it over the support of $p$: $\int_{x:p(x) >0} p(x) \log\dfrac{p(x)}{q(x)}dx$?
For the KL-divergence formula these turn out to be the same, but consider the expectation $\mathbb{E}_{p(x)}[\dfrac{q(x)}{p(x)}] = \int p(x)\dfrac{q(x)}{p(x)}dx = \int q(x)dx$.
In the case of the real line, we have $\int_{-\infty}^\infty q(x)dx = 1$.
In the case of the support of $p$, we have $\int_{x:p(x)>0} q(x)dx$, which is obviously very different.
I believe the second is correct, but I was unable to prove this in a way that satisfied me intellectually. My work is as follows:
Interpreting $p$ as the Radon-Nikodym derivative of an induced measure $\nu$, and letting $S$ represent the support $S = \{x: p(x) > 0\}$, we can calculate $\int \log\dfrac{q(x)}{p(x)}dp = \int_S \dfrac{q(x)}{p(x)}dp + \int_{S^C} \dfrac{q(x)}{p(x)}dp$. We have $\nu(S^C) = \int_{S^C} p(x)dx = 0$, thus the second integral $\int_{S^C} \dfrac{q(x)}{p(x)}dp = 0$ and that leaves us with the integral over the support as desired.
To me, this proof seems valid but it also seems like cheating. I just basically look at the set of measure $0$ and declare that I can ignore it even though the value being integrated over there ($\dfrac{q(x)}{p(x)}$) is infinite. This post on a similar question stated I could do that, but I don't understand why.