i don't know precisely how to deal with it, i just thought i could use the signum function but it's my first time dealing with it so i don't know if it is fine and especcially how to proceed further, anyway this is what i tried: $$ \int_{-2}^{1} ||x+1|-1| \,dx = \int_{-2}^{1} |(x+1)sgn(x+1)-1| $$ $$=\int_{-2}^{1} [(x+1)sgn(x+1)-1) sgn[( (x+1)sgn(x+1)-1]$$ $$=\int_{-2}^{1} [(x+1)sgn(x+1) ]sgn[( (x+1)sgn(x+1)-1] -\int_{-2}^{1} sgn[ (x+1)sgn(x+1)-1]$$$$= \int_{-2}^{1} [(x+1)sgn(x+1) ]sgn[( (x+1)sgn(x+1)-1] -[xsgn[ (x+1)sgn(x+1)-1]^1_{-2} ] $$
i don't know how to proceed, do i need for example to substitute something for then integrating by parts? Anyway thanks for the responses and sorry for the bad English and the bad brackets

There is no need to use the sign function, you just have to reason about the sign of the integrand. First of all, split the integral: $$ \int_{-2}^1 ||x+1|-1| dx=\int_{-2}^{-1} ||x+1|-1| dx+\int_{-1}^1 ||x+1|-1| dx$$ Consider the second integral and note that if $x\in [-1,1]$, then $|x+1|=x+1$. So you have: $$\int_{-1}^1 ||x+1|-1| dx=\int_{-1}^1 |x| dx=-\int_{-1}^0xdx+\int_0^1xdx=1 $$ Now, as we've done before, note that if $x\in[-2,-1]$, you have $|x+1|=-x-1$: $$\int_{-2}^{-1} ||x+1|-1| dx=\int_{-2}^{-1} |-x-2| dx=\int_{-2}^{-1} (x+2) dx=\frac{1}{2} $$ Finally you have: $$ \int_{-2}^1 ||x+1|-1| dx=\frac{3}{2}$$