1) Examining the graph of this piecewise function, we can state the following about the rule of this function
f(x) = 4 if x = [-4,-2] Since it includes -4 and -2
f(x) = 5 if x = (-2, 3] Since it does not includes -2 and includes -2
f(x) = 2 if x = (3, 6] Since it includes 3 and not 6
2) Because a piecewise function is defined within intervals. So that's why it has some segments.