[proofplan]
We first make the event $\{X=1\}$ explicit as the preimage $X^{-1}(\{1\})$, so measurability follows from the measurability of the [random variable](/page/Random%20Variable) $X$. Then we compare the two functions at an arbitrary point $\omega\in\Omega$. Since $X$ only takes the values $0$ and $1$, the definition of the indicator function gives equality in the two possible cases.
[/proofplan]
[step:Identify the event on which the indicator is supported]
Define
\begin{align*}
A:=\{\omega\in\Omega:X(\omega)=1\}=X^{-1}(\{1\}).
\end{align*}
Since $\{1\}\in 2^{\{0,1\}}$ and $X:(\Omega,\mathcal F)\to(\{0,1\},2^{\{0,1\}})$ is measurable, we have $A\in\mathcal F$. Thus the indicator function
$\mathbb{1}_A:\Omega\to\{0,1\}$ is well-defined by the rule $\mathbb{1}_A(\omega)=1$ for $\omega\in A$ and $\mathbb{1}_A(\omega)=0$ for $\omega\notin A$.
[/step]
[step:Check equality at an arbitrary outcome]
Fix $\omega\in\Omega$. Because the codomain of $X$ is $\{0,1\}$, exactly one of the alternatives $X(\omega)=1$ or $X(\omega)=0$ holds.
If $X(\omega)=1$, then $\omega\in A$ by the definition of $A$, so $\mathbb{1}_A(\omega)=1=X(\omega)$.
If $X(\omega)=0$, then $\omega\notin A$ by the definition of $A$, so $\mathbb{1}_A(\omega)=0=X(\omega)$.
Therefore $X(\omega)=\mathbb{1}_A(\omega)$ for every $\omega\in\Omega$, and hence $X=\mathbb{1}_A=\mathbb{1}_{\{X=1\}}$ pointwise on $\Omega$.
[guided]
We prove equality of functions by evaluating both functions at an arbitrary outcome. Let $\omega\in\Omega$ be fixed. The hypothesis that
$X:(\Omega,\mathcal F)\to(\{0,1\},2^{\{0,1\}})$ means that $X(\omega)$ must be either $0$ or $1$.
First suppose $X(\omega)=1$. By the definition
\begin{align*}
A=\{\eta\in\Omega:X(\eta)=1\},
\end{align*}
this condition says exactly that $\omega\in A$. The definition of the indicator function then gives $\mathbb{1}_A(\omega)=1$. Hence
\begin{align*}
\mathbb{1}_A(\omega)=1=X(\omega).
\end{align*}
Now suppose $X(\omega)=0$. Since $0\ne 1$, the condition $X(\omega)=0$ implies that $\omega$ is not an element of the set where $X$ equals $1$. Thus $\omega\notin A$. By the definition of the indicator function, $\mathbb{1}_A(\omega)=0$. Therefore
\begin{align*}
\mathbb{1}_A(\omega)=0=X(\omega).
\end{align*}
The two cases exhaust all possible values of $X(\omega)$. Since the chosen $\omega\in\Omega$ was arbitrary, the equality
\begin{align*}
X(\omega)=\mathbb{1}_A(\omega)
\end{align*}
holds for every $\omega\in\Omega$. This is precisely the pointwise equality $X=\mathbb{1}_A$, and because $A=\{X=1\}$, it gives $X=\mathbb{1}_{\{X=1\}}$.
[/guided]
[/step]