the domain is the interval or set of all valid values for x (the input variable).
the range is the interval or set of all valid values for y or f(x) (the function result variable).
the functional result values for the first piece :
x - 4 for 0 <= x < 2
for x = 0 we get y = -4
for x = 2 we get y = -2
the range for this piece is [‐4, -2).
we use the round bracket to indicate -2 itself is not included, as we have x < 2 (and not x <= 2).
the functional result values for the second piece :
x² - 3x + 4 for 2 <= x < 4
for x = 2 we get 4-6+4 = 2
for x = 4 we get 16-12+4 = 8
the range for this piece is [2, 8)
again, because of x < 4 we use the ")" for 8 (not included).
the functional result values for the third piece :
5 for 4 <= x < 7
the range is simply [5) = [5] because the set contains only one element.
and 5 is already contained in the range of the second piece.
so, the range is just the combination of the ranges of the first 2 pieces :
[-4, -2) U [2, 8)