Writing a formal proof The problem asks to prove that $|(0,1)| = |\mathbb{R}|$
I was thinking that I could prove that $|(0,1)| = |(\frac{-\pi}{2},\frac{\pi}{2})|$ by $f(x) = \pi(x-0.5)$ and then that $|(\frac{-\pi}{2}, \frac{\pi}{2})| = |\mathbb{R}|$ by $g(x) = \tan(x)$.
Is this right? And if so, how do I write a formal proof?
 A: I think you want to say that $(0,1) \cong \mathbb{R}$, where $\cong$ means
that they are homeomorphic.
In this case your idea is correct. You begin to say that $(-\frac{\pi}{2},\frac{\pi}{2})$ is homeomorphic to $(0,1)$ via the function $f$ you gave (spend some words to say that $f$ is an homeomorphism) and then using the function 
$tan(\cdot)$ you say that $(-\frac{\pi}{2},\frac{\pi}{2})$ is homeomorphic to $\mathbb{R}$. In conclusion, $(0,1) \cong \mathbb{R}$ via the map $tan \circ f$, which is an homeomorphism as composition of two homeomorphisms.
A: Your idea is correct. To formalize it into a proof, you just need to show that both $f$ and $g$ are bijections. To show that a function is a bijection, you need to show that it is injective (if $f(x_1)=f(x_2)$, then $x_1=x_2$), and it is surjective (if $y$ is in the codomain, then there exists $x$ in the domain such that $f(x)=y$).
To start, to show that $f$ is injective, you need to show that if $x_1, x_2$ are real numbers such that $\pi(x_1-.5)=\pi(x_2-.5)$, and $x_1\in (0,1), x_2\in (0,1)$, then $x_1=x_2$. This should be fairly easy to show. To show that $f$ is surjective, you need to let $y\in(\frac{-\pi}{2},\frac{\pi}{2})$, then there exists $x\in (0,1)$ such that $\pi(x-.5)=y$. Showing such an $x$ exists is easy, and showing that $x\in(0,1)$ is not much more difficult.
Once you've done that, see if you can apply the same logic to $g$.
A: HINT.-The figure below shows that the two red segments $\color{red}{\overline{ab}}$ and $\color{red}{\overline{AB}}$ of arbitrary distinct lenghts have equal cardinality, the function $f$ defined by the blue ligne being clearly a bijection. Find the analytical expression of $f$ is a good exercise with straight lines in the cartesian plane you can do.
(Giving the coordinates of the four points you have the two lines $aA$ and $bB$ intersecting at the point $O$. Segments $\overline{ab}$ and $\overline{AB}$ don't need to be parallel. Blue line passing by $O$ cuts the two segments at $x$ and $f(x)$, etc). 
 
