The problem is:
Verify that the function
p: [0,2] [0,1] given by p(X) = {X, if 0 < X < 1 2 - X, if 1 < X< 2is a continuous probability density function.
I know in order to be considered a cpdf, f(x) must be positive. It is. And that the integral from -infinity to infinity must equal 1.
In this case that would be the integral of X from 0,1 should equal 1? Same with (2-x) from 1,2?
Actually the function $p$ is not the PDF of a real random variable because the PDF of a real random variable is defined on $\mathbb R$ hence one should rather consider the function $q:\mathbb R\to\mathbb R$ defined by $$ q(x)=\left\{\begin{array}{ccl}0&\text{if}&x\leqslant0\\ x&\text{if}&0\lt x\leqslant1\\ 2-x&\text{if}&1\lt x\leqslant2\\ 0&\text{if}& x\gt2\end{array}\right. $$ Now, $q\geqslant0$ on $\mathbb R$ and $$ \int_\mathbb Rq(x)\,\mathrm dx=\int_0^1x\,\mathrm dx+\int_1^2(2-x)\,\mathrm dx=\text{____}, $$ hence $q$ is indeed a PDF. The continuity is unrelated and it can be checked as for every function.