I know that a function is convex if the following inequality is true:
$$\lambda f(x_1) + (1-\lambda)f(x_2) \ge f(\lambda x_1 + (1-\lambda)x_2)$$
for $\lambda \in [0, 1]$ and $f(\cdot)$ is defined on positive real numbers.
If $f(x)=x^2$, I can write the following:
$$\lambda x_1^2 + (1-\lambda)x_2^2 \ge (\lambda x_1 + (1-\lambda)x_2)^2$$
$$0 \ge (\lambda ^2 - \lambda) (x_1^2 - x_2 ^ 2) $$
But I am not sure if this is true or not. How can I prove this?