Solution to Measure, Integration & Real Analysis by Axler Section 2A Exercise 2A6
Prove that if $a,b\in\mathbf R$ and $a<b$, then $$|(a,b)|=|(a,b]|=|[a,b)|=b-a.$$
Solution 1: Since $(a,b)\subset [a,b]$, by 2.5 and 2.14, we have $$|(a,b)|\leqslant |[a,b]|=b-a.$$Hence to show $|(a,b)|=b-a$, it suffices to show that $|(a,b)|\geqslant b-a$.
Let $\varepsilon>0$ be any positive number which is sufficiently small, for example provided $$2\varepsilon < b-a.$$ Note that $[a+\varepsilon,b-\varepsilon]\subset (a,b)$. Therefore we obtain from 2.5 and 2.14 that $$|(a,b)|\geqslant |[a+\varepsilon,b-\varepsilon]|=b-a-2\varepsilon.$$Because $\varepsilon$ is arbitrary, we conclude that $|(a,b)|\geqslant b-a$. So we have $|(a,b)|=b-a$.
To show $|(a,b]|=b-a$. Notice that $(a,b)\subset (a,b]\subset [a,b]$. It follows from 2.5, 2.14, and $|(a,b)|=b-a$ that $$b-a=|(a,b)|\leqslant |(a,b]|\leqslant |[a,b]|=b-a.$$Therefore $|(a,b]|=b-a$. The part $|[a,,b)|=b-a$ is similar.
Solution 2: By 2.4, we know that $$|\{a,b\}|=|\{a\}|=|\{b\}|=0.$$Hence the part $|(a,b)|=b-a$ follows from Exercise 2A1 by setting $A$ to be $(a,b)$ and $B=\{a,b\}$. The other two can be obtained in a similar way.
Of course, it is also possible to use Exercise 2A3.