Consider $P:A\to\mathbb{R}$ where $P(x)> 0 \text{,} \ $ $A$ is an subset of $\mathbb{R}$ and
$$P(x)= \begin{cases} P_1(x) & x \in A_1\\ P_2(x) & x \in A_2\\ \end{cases}$$
where $A=A_1\cup A_2$ and $A_1,A_2$ are pairwise disjoint.
What is the "most intuitive" average of $P(x)$, for all $x \in A\cap[a,b]$, that is unique and where $a,b\in\mathbb{R}$?
Note “unique” means a system that produces a single average, instead of multiple averages, using reasoning/intuition.
Also note this question is subjective but there are areas of math (such as measure theory) that is based on intuitions/ intuitive properties. For example, we can pick any arbitrary measure to find the average of Dirichlet's Function in $[0,1]$, but instead, we use the Lebesgue measure.
Why is the Lebesgue measure intuitive? Because if real numbers in $[a,b]$ are written as infinite, randomly generated digits; there is zero probability they will represent a number in $[a,b]$. Moreover, there is zero probability that finite, randomly generated digits will repeat infinitely to give rational numbers; hence, these digits have a probability $1$ of being irrational. Say we multiplied these intuitive probabilities times $b-a$. This gives the results of the Lebesgue measure. Hence we can state the Lebesgue measure is intuitive for these cases?
However, if we are focusing on countable $A\cap[a,b]$, it should still have a measure of one and the average of $P$ should exist between the infimum and supermum of its range. The problem is most countably additive measures of $A\cap[a,b]$ is zero giving $P$ an average outside the range.
What measure should we use instead? What do you think are intuitive properties/examples that the average should follow?
Here are two examples, I believe our measure and average should match
If $A$ has a Lebesgue measure of one the average of $P$ should intuitively be
$$\int_{\mu(A_1\cap[a,b])}P_1(x)dx+\int_{\mu(A_2\cap[a,b])}P_2(x)dx$$
Where $\mu$ is a measure that equals the Lebesgue measure (when the Lebesgue measure of $A$ is one).
Even better, we could use the Gauge Integral, which is far more general and doesn't use a measure. However, even the Gauge integral gives the average of $P$ zero, when defined on a domain with zero Lebesgue measure.
Here are two cases that the average of $P$, where the Lebesgue measure of $A\cap[a,b]$ is zero, should intuitively follow.
If $A_1$ and $A_2$ are finite in $[a,b]$, the average of $P$ is
$$\frac{\sum\limits_{i\in A\cap[a,b]}P(i)}{\left|A\cap[a,b]\right|}=\frac{\left|A_1\cap[a,b]\right|\sum\limits_{i_1\in A_1\cap[a,b]}P(i_1)}{\left|A_1\cap[a,b]\right|\left|A\cap[a,b]\right|}+\frac{\left|A_2\cap[a,b]\right|\sum\limits_{i_2\in A_2\cap[a,b]}P(i_2)}{\left|A_2\cap[a,b]\right|\left|A\cap[a,b]\right|}=\frac{\left|A_1\cap[a,b]\right|}{\left|A\cap[a,b]\right|}\sum\limits_{i_1\in A_1\cap[a,b]}P(i_1)\frac{1}{\left|A_1\cap[a,b]\right|}+\frac{\left|A_2\cap[a,b]\right|}{\left|A\cap[a,b]\right|}\sum\limits_{i_2\in A_2\cap[a,b]}P(i_2)\frac{1}{\left|A_2\cap[a,b]\right|}$$
And probability measure $\mu(X\cap[a,b])$ for $X\subseteq A$ is
$$\mathbf{W_1}=\mu(A_1\cap[a,b])=\frac{\left|A_1\cap[a,b]\right|}{\left|A\cap[a,b]\right|}$$
$$\mathbf{W_2}=\mu(A_2\cap[a,b])=\frac{\left|A_2\cap[a,b]\right|}{\left|A\cap[a,b]\right|}$$
$$\mathbf{W}_1\sum\limits_{i_1\in A_1\cap[a,b]}P(i_1)\frac{1}{\left|A_1\cap[a,b]\right|}+\mathbf{W}_2\sum\limits_{i_2\in A_2\cap[a,b]}P(i_2)\frac{1}{\left|A_2\cap[a,b]\right|}$$
If $A_1$ is countable infinite in $[a,b]$ and $A_2$ is finite, since $A\cap[a,b]$ is countably infinite, if $\mathbf{J}_m$ contains all finite subsets of $A\cap[a,b]$ where $\max\limits_{m\in\mathbb{N}}|\mathbf{J}_m|=\left|\mathbf{I}_n\right|\le n$; $\mathbf{I}_n$ is arranged as $\left\{a_1,a_2,...,a_n\right\}$ where $a\le a_1<a_2<...<a_n\le b$, and
$$ \max_{i\le n,i\in\mathbb{N}}\left(\text{diff} (\mathbf{I_n})\right)=\max_{i\le n,i\in\mathbb{N}}\left\{a_2-a_1,a_3-a_2,...,a_n-a_{n-1}\right\}\le K(n)$$
such that $K:S\to\mathbb{R}$, $\mu(S)=1$ and $\lim\limits_{n\to\infty}K(n)=\inf\text{diff}(A)$; then the measures $W_1$ and $W_2$ are
$$\mathbf{W}_{1}=\mathbf{\mu}(A_1\cap[a,b])=\lim_{n\to\infty}\frac{\left|A_1\cap \mathbf{I}_n\cap[a,b]\right|}{\left|\mathbf{I}_{n}\cap[a,b]\right|}$$
$$\mathbf{W}_{2}=\mathbf{\mu}(A_2\cap[a,b])=\lim_{n\to\infty}\frac{\left|A_2\cap \mathbf{I}_n\cap[a,b]\right|}{\left|\mathbf{I}_{n}\cap[a,b]\right|}$$
And $\text{avg}(P)$ is
$$\mathbf{W}_{1}\lim_{n\to\infty}\sum_{i_1\in A_1 \cap I_n \cap [a,b]}P_1(i_1)\frac{1}{\left|A_1\cap I_n\cap[a,b]\right|}+\mathbf{W}_{2}\lim_{n\to\infty}\sum_{i_2\in A_2 \cap I_n \cap [a,b]}P_2(i_2)\frac{1}{\left|A_2\cap I_n\cap[a,b]\right|}$$
Any $\mathbf{I}_n$ gives the same answer but I'm not sure how to prove this.
Moreover, if $A$ is dense in $[a,b]$,
$$\text{avg}(P)=\frac{1}{b-a}\mathbf{W}_1\int_{a}^{b}P_1(x) \ dx+\frac{1}{b-a}\mathbf{W}_2\int_{a}^{b}P_2(x) \ dx=\frac{1}{b-a}(1)\int_{a}^{b}P_1(x) \ dx+\frac{1}{b-a}(0)\int_{a}^{b}P_2(x) \ dx$$
$$\frac{1}{b-a}\int_{a}^{b}P_1(x) \ dx$$
Here's the proof. Since $A$ is dense in $[a,b]$, it can approximate arbitrarily close to any point in $\mathbb{R}$. Hence it's possible for the limits outside the domain to exist. We extend $P:A\to\mathbb{R}$ to $P:A \cup C\to\mathbb{R}$ where for $c\in \mathbb{R}\setminus A$
$$C=\left\{P^{-1}\left(\lim_{\left\{ x\in A\right\}\to c}P(x)\right) \right\}$$
Since $A_1$ is dense in $\mathbb{R}$, $P:A\cup C\to\mathbb{R}$ can be split into $P_1:A_1\cup C\to\mathbb{R}$ and $P_2:A_2\to\mathbb{R}$.
Since $A_2$ is the discontinuties of $P:A\cup C \to \mathbb{R}$ and the Lebesgue measure of $A_2$ is zero, the Lebesgue criteria for reimman integration states the riemman integral for $P_1:A_1\cup C \to \mathbb{R}$ can exist. Hence we apply the mean value theorem of integration on $P_1$.
If $A_1$ and $A_2$ is dense in $[a,b]$ the average is unclear. For one, we could set $\mathbf{I}_n$ to equal subsets of $A_1$, $A_2$ or $A_1\cup A_2$. In this case, $\mathbf{W}_1$ or $\mathbf{W}_2$ could equal anything
I will post my intuition for this example. If you have a measure that matches these intuitions, post it below.
Potential Answer
Definition of Measure
Consider $f:A\to\mathbb{R}$ where $A\subseteq[a,b]$, $a,b \in \mathbb{R}$ and $S\subseteq A$. Here $S$ is a fixed subset of $A$
Suppose we define a Lebesgue Probability Measure $\lambda_{A}(S)$ depending on a fixed set $A$ and $S$. The length of the intervals $I$ and $J$ are given by $\ell(I)=\ell(J)=b-a$. If $\left(I_{k,\epsilon}\right)_{k=1}^{m}$ are subsets of $I$ covering $S$ and $\left(J_{k,\epsilon}\right)_{k=1}^{n}$ are subsets $J$ covering $A$, if $\lambda^{*}$ is the Lebesgue Outer Measure, then the Lebesgue Outer Probability Measure is:
$ \lambda^{*}_{A}(S)= \inf\left\{\frac{\sum\limits_{k=1}^{m}\ell(I_{k,\epsilon}) \bigl[1{-}\mu(A)(1{-}\mu(S\cap I_{k,\epsilon}))\bigr]\text{sign}(|A|)}{\sum\limits_{k=1}^{n}\ell(J_{k,\epsilon}) \bigl[1{-}\mu(A)(1{-}\mu(A\cap J_{k,\epsilon}))\bigr]}: S\subseteq\bigcup\limits_{k=1}^{m} I_{k,\epsilon}, A\subseteq\bigcup\limits_{k=1}^{n} J_{k,\epsilon}, \left|\lambda^{*}(S)-\sum\limits_{k=1}^{m}\ell(I_{k,\epsilon})\right|\le \epsilon, \left|\lambda^{*}(A)-\sum\limits_{k=1}^{n}\ell(J_{k,\epsilon})\right|\le \epsilon, 1\le m \le \max\left\{|S|,1\right\}, 1 \le n \le \max\left\{|A|,1\right\}; P = S\cap I_{k,\epsilon},\\ P= A\cap J_{k,\epsilon} \ \text{or} \ P= A; \mu(P)=\inf\left\{\text{sign}\left(\bigcup\limits_{s=1}^{t}G_s\right): P\subseteq \bigcup\limits_{s=1}^{t} G_s\right\}, 1 \le t \le \max\left\{|P|,1\right\} \right\}$
Where $\text{sign}(0)=0$, when $S$ and $A$ are uncountable $|S|=+\infty$ and $|A|=+\infty$, $\lim\limits_{m \rightarrow \infty} \sum\limits_{k=1}^{m} \ell(I_k)\to\lambda(S)$, $\lim\limits_{n \rightarrow \infty} \sum\limits_{k=1}^{n} \ell(J_k) \rightarrow \lambda(A)$ and in most cases $\epsilon$ should approach zero. Moreover, $\mu(P)=0$ when $P$ is countable and $\mu(P)=1$ when $P$ is uncountable.
Finally
If $\lambda_{A}(S)\neq(\lambda(S)/(b-a))$, we could split $I_{k,\epsilon}$ and $J_{k,\epsilon}$ into two cases.
From these restrictions, Inner Generalized Lebesgue Measure $\lambda_{A*}(S)$ is
\begin{equation} \lambda_{A*}(S)=\lambda_{A}^{*}(A)-\lambda_{A}^{*}(A\setminus S) \end{equation}
And when the limit of the inner and outer measure equal eachother
\begin{align} \lambda_{A}^{*}(S)=\lambda_{A*}(S) =\lambda_{A}(S) \end{align}
Where $\lambda_{A}(S)$ is the Full Lebesgue Probability Measure.
Properties of the Measure
It seems the properties of my measure are:
\begin{equation} \lambda_{\emptyset}(\emptyset)=0 \end{equation}
\begin{equation} \lambda_{A}(\emptyset)=0 \end{equation}
\begin{equation} \lambda_{A}(A)=1 \end{equation}
If $A=A_1\cup A_2$ and both subsets of $A$ are disjoint.
\begin{equation} \lambda_{A}(A_1\cup A_2)=\lambda_{A}(A_1)+\lambda_{A}(A_2) \end{equation}
If $A=\bigcup_{i=1}^{\infty}(A_i)$ then
\begin{equation} \lambda_{A}\left(\bigcup_{i=1}^{\infty}A_i\right)=\sum_{i=1}^{\infty}\lambda_{A}(A_i) \end{equation}
If $A_1=A\setminus A_2$
\begin{equation} \lambda_{A}(A_1)=\lambda_{A}(A)-\lambda_{A}(A_2)=1-\lambda_{A}(A_2) \end{equation}
And if $A=[a,b]$
\begin{equation} \lambda_{A}(A)(b-a)=\lambda(A) \end{equation}
I am not sure how to prove these properties are true. I'd appreciate if someone could help.
Average and Integral
From this, we can start defining the average $f$. We start by defining $f$ as a linear combination of characteristics functions.
\begin{equation} 1_A = \begin{cases} 1 & x \in A \\ 0 & \text{otherwise} \end{cases} \end{equation}
We define the sum as:
\begin{equation} \int 1_A d\lambda_{A} = \lambda_{A}(A) \end{equation}
\begin{equation} S_n = \sum_{i=1}^{n} \int f(c_i) 1_{A_i} d\lambda = \sum_{i=1}^{n} f(c_i) \times \lambda_{A}(A_i) \end{equation}
Where $c_i \in [x_{i-1}, x_{i}]$ and $A_i=A\cap[x_{i-1},x_i]$ such that $a= x_0 \le \dots \le x_n =b$. Note as $n\to\infty$ we get our generalized average.
To get the "integral" multiply $S_n$ by $b-a$ and set $n\to\infty$. My hunch is the "integral" will not give the area under the curve (where we can use the anti-derivatives of $f$) unless $A$ is dense in $[a,b]$.