Proving that the variance is non-negative $$(E(X))^2 = \left( \int_{-\infty}^{+\infty}xf(x) \, dx \right)^2 \le \int_{-\infty}^{+\infty}x^2(f(x))^2 \, dx \le \int_{-\infty}^{+\infty} x^2f(x) \, dx = E(X^2)$$
Because of cauchy-schwarz inequality and $f(x) \le 1$. Is my solution correct?

Let $\mu=\operatorname{E}(X)$.  The variance is $\operatorname{var}(X) = \operatorname{E}((X-\mu)^2)$.  That is non-negative because it's the expectation of a nonnegative random variable.  Now notice that
\begin{align}
& \operatorname{var}(X) = \operatorname{E}((X-\mu)^2) \\[10pt]
= {} & \operatorname{E}(X^2 -2\mu X + \mu^2) \\[10pt]
= {} & \operatorname{E}(X^2) - 2\mu\operatorname{E}(X) + \mu^2 \\[10pt]
= {} & \operatorname{E}(X^2) - 2\mu^2 + \mu^2 \\[10pt]
= {} & \operatorname{E}(X^2) - \mu^2.
\end{align}
If the question is how to prove that that last expression is nonnegative, then one way to prove it is by seeing, as above, that it's equal to the first expression above.
