By the definition for the absolute value,
[tex]|x-1|=\begin{cases}x-1&\text{for }x\ge1\\-(x-1)&\text{for }x<1\end{cases}[/tex]
[tex]|x+1|=\begin{cases}x+1&\text{for }x\ge-1\\-(x+1)&\text{for }x<-1\end{cases}[/tex]
So for the compound function [tex]f(x)=1-|x-1|+|x+1|[/tex], there are three intervals to consider. What happens when [tex]x<-1[/tex]? when [tex]-1\le x<1[/tex]? when [tex]x\ge1[/tex]?
You have
[tex]f(x)=\begin{cases}1-(-(x-1))+(-(x+1))=-1&\text{for }x<-1\\1-(-(x-1))+(x+1)=2x+1&\text{for }-1\le x<1\\1-(x-1)+(x+1)=3&\text{for }x\ge1\end{cases}[/tex]