You cannot determine $E[X^{2}]$ without more information. For $f_{1}(x) = 1$, we have that
$$
E[X] = \int_{0}^{1} x f_{1}(x) \, dx = \int_{0}^{1} x \, dx = \left. \frac{1}{2} x^{2} \right|_{x = 0}^{x = 1} = \frac{1}{2},
$$
and
$$
E[X^{2}] = \int_{0}^{1} x^{2} f_{1}(x) \, dx = \int_{0}^{1} x^{2} \, dx = \left. \frac{1}{3} x^{3} \right|_{x = 0}^{x = 1} = \frac{1}{3}.
$$
For $f_{2}(x) = 12 (x - \frac{1}{2})^{2}$, we have that
$$
E[X] = \int_{0}^{1} x f_{2}(x) \, dx = \int_{0}^{1} 12 x (x - \tfrac{1}{2})^{2} \, dx = \left. \frac{x^{2} (6 x^{2} - 8 x + 3)}{2} x^{2} \right|_{x = 0}^{x = 1} = \frac{1}{2},
$$
and
$$
E[X^{2}] = \int_{0}^{1} x^{2} f_{2}(x) \, dx = \int_{0}^{1} 12 x^{2} (x - \tfrac{1}{2})^{2} \, dx = \left. \frac{x^{3} (12 x^{2} - 15 x + 5)}{5} \right|_{x = 0}^{x = 1} = \frac{2}{5}.
$$