Answer
$$1$$
Work Step by Step
The mass of an object can be found as:
$m=\int_a^b \rho(x) \ dx$
This implies that
$m=\int_0^1 (x^2) \ dx +\int_1^2 x(2-x) \ dx \\=\dfrac{1}{3} |x^3|_0^1+(x^2-\dfrac{1}{3}\times x^3)|_1^2 \\=\dfrac{1}{3}+\dfrac{4}{3}-\dfrac{2}{3} \\=1$