The following definition of a real-valued random variable (evidently) uses the notation $\{ X \in B \}$ for the pre-image of $B$ under $X$:
Let $(\Omega, F, \mathbb{P})$ be a probability space. A random variable is a real-valued function $X$ defined on $\Omega$ with the property that for every Borel subset $B$ of $\mathbb{R}$, the subset of $\Omega$ given by
$$ \{X \in B \} = \{\omega \in \Omega: X(\omega) \in B \} $$
is in the $\sigma$-algebra $F$.
(The definition is more or less quoted from Steve Shreve’s text on stochastic calculus for finance.)
Is $\{ X \in B \}$ a common way to write the pre-image in the context of random variables? Is there some background or motivation for this notation?