I'm first approaching random variables and right after definition I have this: Let $\Omega = \{\omega_1, \omega_2, \omega_3, \dots \}$ be a sample space. Then the image of the random variable is a set like this:
$\mathcal{Im}(X) = \{t_1, t_2, t_3, \dots \}$ with at most countably many $t_j$, which are real numbers.
Of course, then , $X^{-1}(t_j) = E_j$ is an event.
It follows that $X(\omega) = \{t_j \quad \text{if}\;\; \omega \in E_j \} = \sum\limits_{j=1}^\infty t_j\mathcal{X}_{E_j}(\omega)$
where $\mathcal{X}_{E_j}(\omega)$ is the indicator function of $E_j$.
What should be $\omega$ in this case? It's confusing to me that we use some index for $\omega$ when defining the sample set, and we don't use any when talking about the random variable.