# Cardinalities of Sets: Prove |(0, 1)| = |(0, 2)| and |(0, 1)| = |(a, b)|

How to prove the open intervals (0,1) and (0,2) have the same cardinalities? |(0, 1)| = |(0, 2)|

Let a, b be real numbers, where a<b. Prove that |(0, 1)| = |(a, b)|

-----------------------------------
|(0,1)| = |R| = c by Theorem
-----------------------------------

I know that we need to construct a function f: (0,1)->(0,2) and prove f is bijection so that |(0, 1)| = |(0, 2)|

same process of proving |(0, 1)| = |(a, b)|

but how to construct a function f: (0,1)->(0,2)
and how to construct a function g: (0,1)->(a,b) where a<b and a,b are real numbers?

I know how to construct a function f: (0,1)->R
by define a function f(x)=(1-2x)/[x(x-1)] where x cannot be 0 and 1 and when the middle domain(f)=1/2, f(1/2)=0

How can I expand this knowledge and to define a function that the domain(f) is within (0,1) and the range(f) falls into (0,2) or any close interval (a,b)?