Show (a, b) ∼ R for any interval (a, b) 
Show $(a, b)$ has the same cardinality as $R$ for any interval $(a, b)$.

From the previous chapters of the book (Understanding Analysis-Stephen Abbott), I know that $(-1,1)$ has the same cardinality as $R$. I am willing to know is there any systematic way to show this or I have to guess some function $f: (a,b)$ ->$(-1,1)$ that is 1-to-1 and onto?
 A: A straight line joining the points $(a,b)$ and $(-1,1)$ will work. 
$f(x)=1+\frac{b-1}{a+1}(x+1)$
A: One can also directly deploy the linear transformation
$y(x) = \dfrac{\pi}{b - a} \left (x - \dfrac{a + b}{2} \right ), \tag 1$
which takes the interval
$(a, b) \to \left (-\dfrac{\pi}{2}, \dfrac{\pi}{2} \right); \tag 2$
then
$\tan \circ y:(a, b) \to \Bbb R, \; x \to \tan y(x) \tag 3$
is one-to-one and onto; and in fact, it is differentiable and possessed of a differentiable inverse; we know it is one-to-one since its derivative
$(\tan \circ y)'(x) = (\sec^2 y(x)) y'(x) = \dfrac{\pi}{b - a} \sec^2 y(x) > 0, \; x \in (a, b); \tag 4$
thus $\tan \circ y$ is montonically increasing and hence one-to-one; $\tan \circ y$ is seen to be onto since
$\tan \circ y(x) \to -\infty, \; x \to a^+, \tag 5$
$\tan \circ y(x) \to \infty, \; x \to b^-, \tag 6$
and thus for any $\rho \in \Bbb R$ we may choose $a_0, b_0 \in (a, b)$ with
$\rho \in (\tan \circ y (a_0), \tan \circ y(b_0)) \subset [\tan \circ y(a_0), \tan \circ y(b_0) ]; \tag 7$
since then 
$\tan \circ y(a_0) \le \rho \le \tan \circ(b_0), \tag 8$
we have, by the intermediate value theorem,
$\exists z \in [a_0, b_0], \; \rho = \tan \circ y(z), \tag 9$
and we see that $\tan \circ y$ is onto $\Bbb R$.
Now since $\tan \circ y:(a, b) \to \Bbb R$ is both ono-to-one and onto, we conclude that $\vert (a, b) \vert = \vert \Bbb R \vert$ for any $a, b \in \Bbb R, \; a < b$.
