For the first piece, −3≤x<1 makes 0≤x+3<4. Taking nonnegative square roots gives
0≤x+3<2.
For the second piece, 1≤x≤4 gives
0≤x−1≤3.
The output intervals are [0,2) and [0,3], whose union is [0,3]. Although the first piece does not attain 2, the second does, at x=3.