Piecewise[{{x, -1<=x<=1}, {0, |x| > 1}}]