This piecewise function has 3 separate components to it:
The left-most piece is the line labeled with 2x+4. This is why it's listed first in the algebraic definition (i.e. your teacher already filled this part out for you). This piece applies only when -2 <= x < 0
The center piece is y = 4. We leave the "y = " portion out and simply write 4 as the center piece. This says that the output is 4, but only when 0 <= x < 2. That will graph out a flat horizontal portion as the graph shows.
Lastly, the right-most piece is the line y = -2x+8. Again, we leave off the y portion and just write -2x+8. This piece only applies when 2 <= x < 4
Side note: Something like 2 <= x is another way of saying