Explanation:
remember that empty dots mean "exclusive", and dark, filled dots mean "inclusive".
then, regular line functions look like
y = ax + b
with a being the slope (ratio of y/x indicating how much y changes, when x changes), b being the y-intercept (y-value when x = 0).
the left part is simply a line parallel to the x-axis. the slope is 0, as the line is not climbing or declining.
so, it is simply
y = 4
the right part is a line going from (0, 5) to (6, 8).
x changes by +6 (from 0 to 6), y changes by +3 (from 5 to 8). so, the slope is 3/6 = 1/2
and with the starting point at the y-axis we have also the y-intercept.
so, the line equation there is
y = (1/2)x + 5
now together with the proper intervals of validity :
y = 4, -6 < x < 0
y = (1/2)x + 5, 0 < x <= 6