$P(X \le 0)=1$ implies $E(X) \le 0$ Show that $P(X \le 0)=1$ implies $E(X) \le 0$ 
What I attempted:- 
Consider $X$ to be a discrete random variable.  Now, we have 
\begin{equation} \begin{aligned} E(X) &=\sum_{x:x\le 0} x P(X=x)+\sum_{x:x > 0} x P(X=x) \\  &=\sum_{x:x\le 0} x P(X=x) \qquad \mbox{[Because, If} \quad x>0, P(X=x)=0 ]\\ &\le \sum_{x:x\le 0} 0. P(X=x) \qquad \mbox{[we are summing over all} \quad x \le 0] \\ &=0 \end{aligned} \end{equation}  
Similar argument could be made if $X$ is continuous.  
Is my procedure correct? Is there any difference between these two statements $(1)$ $P(X\le 0)=1$ and $(2)$$X\le 0$?
 A: You can give a more general demonstration of this result (where $X$ can be continuous or discrete or a mixture) by expressing the expectation using the Lebesgue-Stieltjes integral.
If $\mathbb{P}(X \leqslant 0) = 1$ then we have $F(x) = 1$ for all $x > 0$, which gives Lebesgue-Stieltjes measure $\mu_F(0,\infty) = 0$.  Using 
Lebesgue-Stieltjes integration we therefore have:
$$\begin{equation} \begin{aligned}
\mathbb{E}(X) = \int \limits_\mathbb{R} x dF(x) 
&= \int \limits_{x \leqslant 0} x dF(x) + \int \limits_{x > 0} x dF(x) \\[6pt]
&= \int \limits_{x \leqslant 0} x dF(x) + 0 \\[6pt]
&= \int \limits_{x \leqslant 0} x dF(x) \leqslant 0, \\[6pt]
\end{aligned} \end{equation}$$
were the transition to the second line occurs because $\mu_F(0,\infty) = 0$ and the final inequality occurs because the integrand is non-positive.
A: A random variable $X$ is said to be integrable if $\mathbb E[X^+]$ and $\mathbb E[X^-]$ are both finite, where
\begin{align}
X^+ &:= \max\{X,0\}\\
X^- &:= \max\{-X,0\}.
\end{align}
Then by definition, $$\mathbb E[X] := \mathbb E[X^+] - \mathbb E[X^-]. $$
If $\mathbb P(X\leqslant 0)=1$, then $\mathbb E[X^+]=0$ (since $X^+\geqslant0$ a.s.), so $\mathbb E[X]=-\mathbb E[X^-]<0$.
