Measurability of (random) set valued functions Consider the following problem.  Given a set $A\in \mathcal{B}(\mathbb{R})$, we have the associated indicator function $1_A(x) \in L^\infty(\mathbb{R})$, is this mapping, $A\mapsto 1_A$ in some sense measurable, and if so, how?
This is part of a larger question I’m thinking about, where $A$ is random in some simple way, $A= (a,b)$, where $a<b$ are random variables.  So we really have the composition of three maps
$$
\omega \mapsto (a(\omega), b(\omega))\mapsto A\mapsto 1_A,
$$
And I am really curious about the measurability of  the random indicator function.
 A: Your intuition is correct, and indeed $1_\bullet$ is (more than) measurable. In particular, in your example of the indicator function of a random interval, $1_\bullet$ should have no effect on randomness, that is, no statistical property should depend on whether or not you are considering an event as a set or as a function.

First I'd like to mention some heuristics as to why $1_\bullet$ is so natural that it could be ignored.

*

*[Categorical POV] It's a categorical function (a simple case of a subobject classifier as in https://ncatlab.org/nlab/show/subobject+classifier), and as such, it ought to be naturally natural (which statement ought to have a natural accompanying proof too).

*[Measure rigidity POV] $1_\bullet$ is not some arbitrary function; indeed it respects the algebraic structures carried by sets and functions. By the general philosophy of measure rigidity (as in https://www.ams.org/notices/200905/rtx090500600p.pdf), if it is measurable it ought to be continuous (to say the least).

*[Functional Analysis POV] For practical purposes it is even valid to think of the collection of subsets as a subspace of all functions. E.g. see Zimmer's Ergodic Theory and Semisimple Groups, pp.150-151, where the collection of Borel measurable subsets are identified with the weakstar-closed subspace of $L^\infty$ consisting of idempotent functions (here idempotent means $(f(x))^2=f(x)$); here of course negligible differences ought to be neglected. Note that this item I am mentioning is actually bypassing your question (while the other two previous items dismiss it): no measure space $(X,\mu)$ for which $1_\bullet=1_\bullet^{(X,\mu)}:\mathcal{B}(X)/\mathcal{N}(\mu)\hookrightarrow L^\infty(X,\mu)$ is not an embedding will be considered, even if this were possible.


Given the heuristics above, now I'd like to present a classical argument (for comparison purposes one may call it an argument from the measure theory POV) that
$$1_\bullet: \{\text{measurable subsets}\} \to \{\text{measurable functions}\}$$
ought to be continuous (and hence Borel measurable).
Let us denote by $\mathcal{B}$ the measure algebra of $\mathbb{R}$ induced by its Borel $\sigma$-algebra and Lebesgue measure $\lambda$. $\mathcal{B}$ is by definition the $\sigma$-algebra of equivalence classes of the relation given by $B_1\sim B_2 \iff \lambda(B_1\triangle B_2)=0$ (This is the LHS of the indicator function in item 3 above). Recall that $B_1\triangle B_2 = (B_1\setminus B_2)\cup (B_2\setminus B_1)$ is the symmetric difference of the subsets $B_1$ and $B_2$.
There are multiple ways of defining a topological (and indeed a uniform) structure on $\mathcal{B}$; the more common ones use the "measure of symmetric differences". One minor issue is that $(\mathbb{R},\lambda)$ is $\sigma$-finite (instead of finite); to deal with this we can allow infinite distances and do some manipulations if necessary, or we can chop up $\mathbb{R}$ into parts of finite measure and consider a family of pseudometrics (see the discussion at Metric assuming the value infinity).
To that end, following the latter strategy, define for $n\in\mathbb{Z}_{\geq1}: K_n=[-n,n]$, and
$$\rho_n:\mathcal{B}\times \mathcal{B}\to [0,1], (B_1,B_2)\mapsto\lambda(B_1\triangle B_2\,\vert\, K_n)=\dfrac{\lambda((B_1\triangle B_2)\cap K_n)}{2n}.$$
Note that $\rho_\bullet$ is a countable family of pseudometrics (i.e. each $\rho_n$ is a function that satisfies all properties of a metric except separating points). Assembling these into a convergent series gives (say)
$$\rho: \mathcal{B}\times \mathcal{B}\to [0,1], (B_1,B_2)\mapsto \sum_{n\in\mathbb{Z}_{\geq1}}\dfrac{1}{2^n}\rho_n(B_1,B_2).$$
Here are some examples:
Ex.1: $\rho_n(\emptyset, K_m)=\begin{cases} 1&\text{, if } 1\leq n\leq m\\\dfrac{m}{n}&\text{, if } m<n \end{cases}$.
Ex.2: $\rho_n(\emptyset, [-1/m,1/m])=2/m=\rho(\emptyset,[-1/m,1/m])$, $\lim_{m\to\infty}\rho(\emptyset,[-1/m,1/m])=0$.
Ex.3: $\rho_n(\emptyset,\mathbb{R})=1, \rho(\emptyset,\mathbb{R})=1$.
Ex.4: $\rho_n(K_m,\mathbb{R})=\begin{cases} 1&\text{, if } 1\leq n\leq m\\\dfrac{n-m}{n}&\text{, if } m<n \end{cases}$, $\rho(K_m,\mathbb{R})\lesssim \dfrac{1}{2^m}$, so that $\lim_{m\to \infty} \rho(K_m,\mathbb{R})=0$.

Endow $L^\infty$ with the weakstar topology, so that $\lim_{m\to \infty} g_m=g_\infty$ iff
$$\forall f\in L^1: \lim_{m\to\infty} \int_{\mathbb{R}}f(x)(g_n(x)-g_\infty(x))\, dx=0.$$
Claim: $1_\bullet:(\mathcal{B},\rho)\to (L^\infty,\text{weakstar})$ is a topological embedding.
Proof: Let's first show continuity. By a standard reduction argument it suffices to take a compactly supported $f$; say the support of $f$ is contained in $K_n$. Let $\lim_{m\to\infty}\rho(B_m,B)=0$. Note that $|1_{B_m}-1_{B}|=1_{B_m\triangle B}$. Then
\begin{align*}
&\left\vert\int_{\mathbb{R}}f(x)(1_{B_m}(x)-1_B(x))\, dx\right\vert
\leq\int_{\mathbb{R}}\vert f(x)\vert\, 1_{(B_m\triangle B)\cap K_n}(x)\, dx\\
&\leq |f|_{C^0} \lambda((B_m\triangle B)\cap K_n)
\lesssim_{f,n} \rho_n(B_m,B)\stackrel{m\to\infty}{\to}0.
\end{align*}
Next note that $\operatorname{im}(1_\bullet)$ is exactly the closed subspace of idempotent bounded measurable functions (as in item 3 above). More precisely, if $g$ is idempotent ($\lambda$-a.e.), then putting $B=g^{-1}(1)$, we have that $B\in \mathcal{B}$ is the unique element such that $1_B=_{\lambda} g$. Thus $B= (1_\bullet)^{-1}(g)$. That $(1_\bullet)^{-1}$ is continuous is clear, as, for $g$ and $h$ idempotent
$$\rho_n(g^{-1}(1),h^{-1}(1))= 2n \int_\mathbb{R} 1_{K_n}(x) |g(x)-h(x)|\, dx.$$

One could argue that in this context instead of $L^\infty$ functions it is more natural to consider $L^0$ functions (i.e. measurable functions, identified a.e.), endowed with the topology of convergence in measure, or even $L^1$ functions (and focusing on the $\sigma$-ideal of measurable subsets of finite measure). For an account of these (and much more, in full generality) see Fremlin's Measure Theory (Vol. 3; items 323, 363G, 367R, to say the least).
