Trouble understanding cardinality

Hi guys I am having trouble understanding cardinality. I am given this practice question.

1) Use Cantor-Schroder-Bernstein Theorem to prove that the intervals $(0,1)$ and $[0,1]$ have the same cardinality?

My attempt :

I know the CSB theorem is

Let $A, B$ be sets and if $f: A \rightarrow B$ , and $g: B \rightarrow A$ are both injections, then there exists a bijection from $A$ to $B$

I have to show that $|(0,1)| = |[0,1]|$ so we need $f: (0,1) \rightarrow [0,1]$ and we can set $f(x) = x$ and also we need $g: [0,1] \rightarrow (0,1)$ and we can let $g(x) = \frac{1}{2}x + \frac{1}{4}$

but after I get stuck I dont know what to do i know have to set these equations up but get confused after.

Please help out any help or hints will be greatly appreciated

Thank you

You’re done as soon as you verify that the maps $f$ and $g$ are injections, that the range of $f$ is a subset of $[0,1]$, and that the range of $g$ is a subset of $(0,1)$: at that point you have an injection $f:(0,1)\to[0,1]$ and an injection $g:[0,1]\to(0,1)$, and the CSB theorem tells you outright that there exists a bijection $h:[0,1]\to(0,1)$ and hence that $\left|[0,1]\right|=\left|(0,1)\right|$.
• @MathGeek: All you have to prove is that your functions are injective (one-to-one). Is it true that if $f(x)=f(y)$, then $x=y$? Very obviously yes, since $f(x)=x$ and $f(y)=y$. Is it true that if $g(x)=g(y)$, then $x=y$? Again the answer is yes, though this time it takes just a little algebra to verify the fact. – Brian M. Scott Apr 15 '13 at 11:33