The following is exercise 1.4.10 from the book "Probability Theory: Independence, Interchangeability, Martingales" by Chow & Teicher:
For any linear Borel set $B$ and random variable $X$, prove that $$\sigma(XI_{[ X\in B ]}) = X^{-1}(B) \cap \sigma(X)$$ where $I_{[ X\in B ]}$ is the indicator function $I_{[ X\in B ]}(w) = 1 $ if $X(w)\in B $, and $=0$ otherwise.
However, I think that the statement is not always true.
For example, let $B := [0, 1]$, $X: [-\infty, \infty] \rightarrow [-\infty, \infty]$ be defined by $$ X(w) := \begin{cases} 0, & \text{if $w \in [-\infty, -1] $} \\ 1, & \text{if $w \in (-1, 0]$ } \\ 2 & \text{if $w \in (0, \infty]$ } \\ \end{cases} $$ then for $Y(w) := X(w)I_{[ X\in B ]}(w)$, $$ Y(w) = \begin{cases} 0, & \text{if $w \in [-\infty, -1] $} \\ 1, & \text{if $w \in (-1, 0]$ } \\ 0 & \text{if $w \in (0, \infty]$ } \\ \end{cases} $$ so that $Y^{-1}(\{0\}) = [-\infty, -1] \cup (0, \infty] $, which cannot be a subset of $X^{-1}(B) = [-\infty, 0]$.
Am I correct?
Thanks for the comments for clarifying the situation. I try to revise the question myself and give an answer here:
Answer: