In my textbook it's estimating $\mu = P(X > 2)$ with monte carlo estimation, and I'm confused about the line $\mu = P(X > 2) = E(\mathbb{1}_{\{X>2\}})$.
What would the $\mathbb{1}_{\{X>2\}}$ mean ?
It's used earlier as a remark "Let $A$ be a proper subset of $\mathbb{R}^d$. If $g(x) = \mathbb{1}_A(x)$, then $E(g(X)) = E(\mathbb{1}_A(X)) = 0 \times P(\mathbb{1}_A(x) = 0) + 1 \times P(\mathbb{1}_A(x) = 1) $
This is called an indicator function. Indicators return 1 if the condition is satisfied, zero otherwise.
So, when we write $1_{ \{X > 2\} }$, we mean that this function returns $1$ if the random variable $X$ has a value larger than $2$, and $0$ otherwise. Indicator functions can simplify some computations in probability.