By the definition.
For a random variable U,\(E\left( U \right) = \sum\limits_{} {rp(U = r)} \)for all\(r \in \).sample space.
Since X, Y are non-negative, E(X) and E(Y) are nonnegative since the expectation is the product of the random variable and probabilities both of which are non-negative.
Consider the set A, of all s such that\(X\left( s \right) \ge Y\left( s \right)\)
For \(s \in A\), \(Z\left( s \right) = X\left( s \right)\)
Which means\(E\left( Z \right) = E\left( X \right)\)
Hence\(E(Z) \le E(X) + E(Y)\)as\(E(Y)\)is nonnegative.
Similarly, Consider the set B, of all s such that\(X\left( s \right) < Y\left( s \right)\)
For \(s \in B\), \(Z\left( s \right) = Y\left( s \right)\)
Which means\(E\left( Z \right) = E\left( Y \right)\)
Hence\(E(Z) \le E(X) + E(Y)\)as\(E(X)\)is nonnegative
Since X and Y are defined for all points s in S, the union of all points s such that \(X\left( s \right) \ge Y\left( s \right)\) and all points such that \(X\left( s \right) < Y\left( s \right)\) gives the sample space S.