I was reading an answer here in math stackexchange and it mentioned this:
Linearity of Expectation then follows from its definition.
$\begin{align} \mathsf E(X+Y) =&~ \sum_{\omega\in\Omega} (X+Y)(\omega)~\mathsf P(\omega) \\[1ex] =&~ \sum_{\omega\in \Omega} X(\omega)~\mathsf P(\omega)+\sum_{\omega\in \Omega} Y(\omega)~\mathsf P(\omega) \\[1ex] =&~ \mathsf E(X)+\mathsf E(Y) \end{align}$
What does the symbol $\omega$ stand for?
You are dealing with a probability space $(\Omega, \mathcal{F}, \mathbb{P})$; and your random variable $X$ is a measurable function $X\colon \Omega\to S$, from the sample space to the state space.
Then, $\omega$ is just an element of $\Omega$. $X(\omega)$ is the realization of the random variable, $\mathbb{P}(\omega)$ is the probability of $\omega$.