I am assuming that you are dealing with continous variables. That is the numbers on the real line not discrete steps.
The reason that Z is between 1 and 2 includes 1 and 2 is as follows:
There is an infinite number of points on the number line between and including 1 and 2. Probability is the number of success events divided by the total number of events. So the probability of exactly 1 is one event divided by infinity = 0 and the probability of exactly 2 is 1 over infinity = 0.
You can add these probabilities so p(1<= z <= 2) = p(z=1) + p(1< z < 2) + p(z=2) = 0 + p(1< z < 2) + 0 = p(1< z < 2)