[proofplan]
We prove both directions directly from the definitions. In the forward direction, independence of the events gives the product formula not only for intersections of the $A_i$, but also for intersections in which any $A_i$ is replaced by $A_i^c$; this follows by finite additivity and inclusion-exclusion over the complemented indices. Since every Borel preimage of an [indicator random variable](/page/Indicator%20Random%20Variable) is one of $\varnothing$, $\Omega$, $A_i$, or $A_i^c$, this proves independence of the indicators. In the reverse direction, we test independence of the random variables against the Borel set $\{1\}$, whose preimage under $X_i$ is exactly $A_i$.
[/proofplan]
[step:Declare the indicator maps and their Borel preimages]
For each $i \in \{1,\ldots,n\}$, define
\begin{align*}
X_i:(\Omega,\mathcal F)&\to(\mathbb R,\mathcal B(\mathbb R))
\end{align*}
\begin{align*}
\omega&\mapsto \mathbb{1}_{A_i}(\omega).
\end{align*}
Since $A_i \in \mathcal F$, the map $X_i$ is measurable: for every Borel set $B \in \mathcal B(\mathbb R)$,
\begin{align*}
X_i^{-1}(B)=
\begin{cases}
\Omega, & 0 \in B \text{ and } 1 \in B,
\end{align*}
\begin{align*}
A_i, & 1 \in B \text{ and } 0 \notin B,
\end{align*}
\begin{align*}
A_i^c, & 0 \in B \text{ and } 1 \notin B,
\end{align*}
\begin{align*}
\varnothing, & 0 \notin B \text{ and } 1 \notin B.
\end{cases}
\end{align*}
Each of these four sets belongs to $\mathcal F$.
[/step]
[step:Derive the product formula for arbitrary choices of events and complements]
Assume that the events $A_1,\ldots,A_n$ are independent. Thus, for every nonempty set $J \subset \{1,\ldots,n\}$,
\begin{align*}
\mathbb P\left(\bigcap_{j\in J} A_j\right)=\prod_{j\in J}\mathbb P(A_j).
\end{align*}
We first prove that for every choice of sets $D_i \in \{A_i,A_i^c\}$, indexed by $i \in \{1,\ldots,n\}$,
\begin{align*}
\mathbb P\left(\bigcap_{i=1}^n D_i\right)=\prod_{i=1}^n \mathbb P(D_i).
\end{align*}
Let $T=\{i\in\{1,\ldots,n\}:D_i=A_i\}$ and $S=\{i\in\{1,\ldots,n\}:D_i=A_i^c\}$. Define
\begin{align*}
E_T:=\bigcap_{i\in T}A_i,
\end{align*}
with the convention that $E_\varnothing=\Omega$. By finite additivity applied to the disjoint decomposition determined by the events $(A_i)_{i\in S}$, equivalently by finite inclusion-exclusion,
\begin{align*}
\mathbb P\left(E_T\cap\bigcap_{i\in S}A_i^c\right)
=
\sum_{R\subset S}(-1)^{|R|}\mathbb P\left(E_T\cap\bigcap_{i\in R}A_i\right).
\end{align*}
For each $R\subset S$, independence gives
\begin{align*}
\mathbb P\left(E_T\cap\bigcap_{i\in R}A_i\right)
=
\prod_{i\in T\cup R}\mathbb P(A_i),
\end{align*}
where the empty product is $1$. Therefore
\begin{align*}
\mathbb P\left(E_T\cap\bigcap_{i\in S}A_i^c\right)
=
\sum_{R\subset S}(-1)^{|R|}
\prod_{i\in T\cup R}\mathbb P(A_i).
\end{align*}
Factoring out the terms indexed by $T$ and expanding the finite product over $S$ gives
\begin{align*}
\mathbb P\left(E_T\cap\bigcap_{i\in S}A_i^c\right)
=
\left(\prod_{i\in T}\mathbb P(A_i)\right)
\left(\prod_{i\in S}(1-\mathbb P(A_i))\right).
\end{align*}
Since $\mathbb P(A_i^c)=1-\mathbb P(A_i)$, this is exactly
\begin{align*}
\mathbb P\left(\bigcap_{i=1}^n D_i\right)=\prod_{i=1}^n \mathbb P(D_i).
\end{align*}
[guided]
Assume that the events $A_1,\ldots,A_n$ are independent. By definition, this means that every nonempty subfamily satisfies the product formula:
\begin{align*}
\mathbb P\left(\bigcap_{j\in J} A_j\right)=\prod_{j\in J}\mathbb P(A_j)
\end{align*}
for every nonempty set $J\subset\{1,\ldots,n\}$.
Why do we need more than this? To prove independence of the indicator random variables, we must handle Borel preimages such as $X_i^{-1}(B)$. These preimages can be $A_i$, but they can also be $A_i^c$, $\Omega$, or $\varnothing$. Thus we must show that replacing any of the independent events by its complement preserves the same product formula.
Fix a choice $D_i\in\{A_i,A_i^c\}$ for every $i\in\{1,\ldots,n\}$. Let
\begin{align*}
T:=\{i\in\{1,\ldots,n\}:D_i=A_i\}
\end{align*}
and
\begin{align*}
S:=\{i\in\{1,\ldots,n\}:D_i=A_i^c\}.
\end{align*}
Define the event
\begin{align*}
E_T:=\bigcap_{i\in T}A_i,
\end{align*}
with the convention $E_\varnothing=\Omega$. The event whose probability we need is
\begin{align*}
E_T\cap\bigcap_{i\in S}A_i^c.
\end{align*}
We now remove the complements by finite inclusion-exclusion. Since $S$ is finite, finite additivity of the [probability measure](/page/Probability%20Measure) gives
\begin{align*}
\mathbb P\left(E_T\cap\bigcap_{i\in S}A_i^c\right)
=
\sum_{R\subset S}(-1)^{|R|}
\mathbb P\left(E_T\cap\bigcap_{i\in R}A_i\right).
\end{align*}
Each event inside the probability on the right is an intersection only of events of the form $A_i$, so the assumed independence applies. Hence, for every $R\subset S$,
\begin{align*}
\mathbb P\left(E_T\cap\bigcap_{i\in R}A_i\right)
=
\prod_{i\in T\cup R}\mathbb P(A_i).
\end{align*}
Substituting this into the inclusion-exclusion formula gives
\begin{align*}
\mathbb P\left(E_T\cap\bigcap_{i\in S}A_i^c\right)
=
\sum_{R\subset S}(-1)^{|R|}
\prod_{i\in T\cup R}\mathbb P(A_i).
\end{align*}
The factors with indices in $T$ do not depend on $R$, so they factor out:
\begin{align*}
\mathbb P\left(E_T\cap\bigcap_{i\in S}A_i^c\right)
=
\left(\prod_{i\in T}\mathbb P(A_i)\right)
\sum_{R\subset S}(-1)^{|R|}
\prod_{i\in R}\mathbb P(A_i).
\end{align*}
The remaining finite sum is the expansion of the product
\begin{align*}
\prod_{i\in S}(1-\mathbb P(A_i)).
\end{align*}
Therefore
\begin{align*}
\mathbb P\left(E_T\cap\bigcap_{i\in S}A_i^c\right)
=
\left(\prod_{i\in T}\mathbb P(A_i)\right)
\left(\prod_{i\in S}(1-\mathbb P(A_i))\right).
\end{align*}
Because $\mathbb P(A_i^c)=1-\mathbb P(A_i)$ for each $i$, this becomes
\begin{align*}
\mathbb P\left(\bigcap_{i=1}^nD_i\right)
=
\prod_{i=1}^n\mathbb P(D_i).
\end{align*}
This proves the product formula for all choices of the events and their complements.
[/guided]
[/step]
[step:Use the preimage classification to prove independence of the indicators]
Let $B_1,\ldots,B_n \in \mathcal B(\mathbb R)$ be arbitrary Borel sets. For each $i\in\{1,\ldots,n\}$, define
\begin{align*}
C_i:=X_i^{-1}(B_i).
\end{align*}
By the preimage classification above, each $C_i$ is one of $\varnothing$, $\Omega$, $A_i$, or $A_i^c$.
If some $C_i=\varnothing$, then
\begin{align*}
\mathbb P\left(\bigcap_{i=1}^n C_i\right)=0=\prod_{i=1}^n\mathbb P(C_i).
\end{align*}
If no $C_i$ is empty, then each $C_i$ is one of $\Omega$, $A_i$, or $A_i^c$. The indices with $C_i=\Omega$ do not affect either the intersection or the product, because intersecting with $\Omega$ changes no set and $\mathbb P(\Omega)=1$. Applying the product formula from the previous step to the remaining indices gives
\begin{align*}
\mathbb P\left(\bigcap_{i=1}^n X_i^{-1}(B_i)\right)
=
\prod_{i=1}^n\mathbb P\left(X_i^{-1}(B_i)\right).
\end{align*}
Since the Borel sets $B_1,\ldots,B_n$ were arbitrary, the random variables $X_1,\ldots,X_n$ are independent.
[/step]
[step:Recover event independence by testing the indicators at the value $1$]
Conversely, assume that the random variables $X_1,\ldots,X_n$ are independent. Let $J\subset\{1,\ldots,n\}$ be nonempty. For each $i\in\{1,\ldots,n\}$, define the Borel set
\begin{align*}
B_i:=
\begin{cases}
\{1\}, & i\in J,
\end{align*}
\begin{align*}
\mathbb R, & i\notin J.
\end{cases}
\end{align*}
Then
\begin{align*}
X_i^{-1}(B_i)=
\begin{cases}
A_i, & i\in J,
\end{align*}
\begin{align*}
\Omega, & i\notin J.
\end{cases}
\end{align*}
Using independence of the random variables with these Borel sets gives
\begin{align*}
\mathbb P\left(\bigcap_{i=1}^n X_i^{-1}(B_i)\right)
=
\prod_{i=1}^n\mathbb P\left(X_i^{-1}(B_i)\right).
\end{align*}
Substituting the identified preimages,
\begin{align*}
\mathbb P\left(\bigcap_{j\in J}A_j\right)
=
\left(\prod_{j\in J}\mathbb P(A_j)\right)
\left(\prod_{i\notin J}\mathbb P(\Omega)\right).
\end{align*}
Since $\mathbb P(\Omega)=1$, this becomes
\begin{align*}
\mathbb P\left(\bigcap_{j\in J}A_j\right)
=
\prod_{j\in J}\mathbb P(A_j).
\end{align*}
Because $J$ was an arbitrary nonempty subset of $\{1,\ldots,n\}$, the events $A_1,\ldots,A_n$ are independent.
[/step]