The solutions with the horizontal lines are wrong because then h(x) would be -1 and 1 respectively.
The subtlety is in the open or closed dot. x ≥ -1 means that -1 is included, which is drawn as a closed dot. x < -1 means that -1 is excluded, which is drawn as an open dot.