Two sets are "equivalent" if and only if there exist an invertible function that maps every point in the first set to every point in the other set. Your first problem requires that you find an invertible function that maps (0, 1) to (a, b). You want to use f(x)= (bx+ a/2)/2 which **is** invertible. But f(0)= a/4 and f(1)= b/2+ a/4. That does NOT map (0, 1) to (a, b).

But there is a more serious problem. To do this problem you should know that a **continuous** invertible function must map open sets to open sets and closed sets to closed sets. Since [0, 1] is closed but none of (a, b), [a, b), or (a, b] are closed, no continuous, and certainly no **linear** function will work. I would recommend something like: map every irrational number to itself and then use the fact that the set of rational numbers in both [0, 1], (a, b), [a, b), (a, b] are countable.