Proof (Bayes classifier)
For any classifier $δ$, $$ \begin{align*} R_π(δ) ={}& π_1 \prob[δ(X) = 0 \mid Y = 1] + π_0 \prob[δ(X) = 1 \mid Y = 0] \\ ={}& \int_{\mathcal{X}} π_1 f_1(x) \mathbb{1}_{\{δ(x) = 0\}} + π_0 f_0(x) \mathbb{1}_{\set{δ(x) = 1}} \d x. \end{align*} $$ The integrand is minimsed if $$ \begin{align*} δ(x) = \begin{cases} 1, &\text{if $π_0f_0(x) < π_1 f_1(x)$}, \\ 0, &\text{otherwise}. \end{cases} = δ_π(x). \end{align*} $$
If $δ$ is a Bayes classifer, then $$ \begin{align*} 0 ={}& R_π(δ) - R_{π}(δ_π) \\ ={}& \int_{\mathcal{X}} π_1 f_1(x) \mathbb{1}_{\set{δ(x) = 0}} + π_0 f_0(x) \mathbb{1}_{\{δ(x) = 1\}} - \min\set{π_1 f_1(x), π_0 f_0(x)}\d x \end{align*} $$ where the integrand is non-negative. Therefore $A := \sb{x\in \mathcal{X}}{π_1 f_1(x) \mathbb{1}_{\set{δ(x) = 0}} + π_0 f_0(x) \mathbb{1}_{\set{δ(x)=1}} > \min\set{π_1 f_1(x), π_0 f_0(x)}}$ has Lebesgue measure 0, so has measure 0 with respect to the law of $X$.
Given that $B:=\sb{x\in \mathcal{X}}{π_1 f_1(x)\neq π_0 f_0(x)}$ has measure 0 with respect to the law of $X$, $\mathcal{X} \setminus (A \cup B)$ has measure 1, meaning $δ(X) = δ_π(X)$ almost surely.