Exercise on derivative of an integral

Solution 1:

After correcting your text I explained in my comment, observe that $f_X(x)$ is a triangular function (it's a triangular density function) while $g(x)$ is a CDF.

Your $f_X(x)$ can be expressed in a more compact form:

$$f_X(x)=[1-|1-x|]\cdot\mathbb{1}_{[0;2]}(x)$$

and, given that it is a triangle, it is not derivable in $x=0;1;2$

To calculate $g(x)$, easy find it by integration finding

$$g_X(x)=\frac{x^2}{2}\cdot\mathbb{1}_{[0;1]}(x)+\left( 2x-\frac{x^2}{2}-1 \right)\cdot\mathbb{1}_{(1;2]}(x)+\mathbb{1}_{(2;+\infty)}(x)$$

which is derivable everywhere