The problem is: Let $X$, $Y$ be positive random variables on a sample space $\Omega$. Assume that $X(\omega)\geq Y (\omega)$ for all $\omega \in \Omega$. Prove that $\operatorname{E} X \geq \operatorname{E}Y$ . I have a little bit confused about how to use ω here. I did not treat random variable as function before.
Thank you
You have $\Pr(X-Y\ge0) =1$ and $\operatorname{E}(X-Y)=\operatorname{E}(X)- \operatorname{E}(Y)$.
If $\Pr(X-Y=0)=1$ then $\operatorname{E}(X-Y) = \operatorname{E}(0)=0.$ If $\Pr(X-Y=0)<1$ then $$ 0 < \Pr(X-Y>0) = \Pr(X-Y>1) + \sum_{n=1}^\infty \Pr\left( \frac 1 {n+1} < X-Y \le \frac 1 n \right), $$ so at least one term of that sum is strictly positive. So for some $n\in\{1,2,3,\ldots\}$ you have $$ \Pr\left(X-Y >\frac 1 n \right) = p > 0, $$ and thus $$ \operatorname{E}(X-Y) \ge \frac 1 n \cdot p > 0. \tag 1 $$
Postscript on the nature of expected value: One may speak of $X$ as a function from $\Omega$ into $\mathbb R$, but I think it's usually better to speak of the probability distribution of $X$ on subsets of $\mathbb R$. How, then, should one define the concept of expected value? For discrete random variables $X$ one writes $$ \operatorname{E}(X) = \sum_x x\Pr(X=x), $$ where $x$ runs through the set of all possible values that $X$ can take with positive probability. For other random variables one writes $$ \operatorname{E}(X) = \operatorname{E}(X\cdot1_{X\ge0} - \operatorname{E}( -X\cdot 1_{X<0}), $$ and one must then define $\operatorname{E}(X)$ for random variables $X$ that satisfy $\Pr(X\ge0)=1$.
The way to do that is first to say that for any finite set of numbers $0<a_1<\cdots<a_n$, every number smaller than $$ a_1 \Pr(a_2>X\ge a_1) + a_2 \Pr(a_3>X\ge a_1) + \cdots + a_n \Pr(X\ge a_n) $$ is too small to be the expected value, and then define the expected value as the smallest number that is not too small (and if all are too small, then the expected value is $\infty$).
This definition justifies line $(1)$ above. One could almost say that line $(1)$ above justifies this definition, although in addition to line $(1)$, one would probably want a characterization of expected value to mention linearity.