Defining a function via restrictions of many bijections I'm trying to define a certain surjective map from $(0,1) \to (0,1)$. For any $(a,b) \subseteq [0,1]$, there's a bijection $(a,b) \rightarrow (a,b) \cup (\frac{1}{3},\frac{2}{3})$. Is there a way to define these bijections such that they're all "compatible"? Basically I'm searching for a well-defined function that on intervals of the above form has the same behavior as the above? Thank you for any help/advice!
 A: Let $I=(\frac13,\frac23)$ and $J=(a,b)$, and assume $f$ is the map from $(0,1)$ to itself which gives a "compatible choice" for all the bijections, by which is meant that the restriction of the single map $f$ to the domain of each suppoped bijection gives that bijection.
The requirements then are that:
[1]  For any $J$ the map $f:J \to J \cup I$ be a bijection. 
Now note that $I \cup I=I.$ so taking $J=I$ in [1] gives that $f:I \to I$ is a bijection.
Next take any interval $K$ which is a proper subset of $I$, and note that $K \cup I=I$, so that applying [1] with $J=K$ gives that $f:K \to I$ is a bijection. This is a contradiction, since $K$ is a proper subset of $I$ and $f$ is already a bijection from $I$ to $I$.
To bring out the contradiction: Choose $x$ in $I$ but not in $K$. Then $f(x) \in I$, so that since $f:K \to I$ is onto there is $y \in K$ for which $f(y)=f(x)$. This contradicts that $f$ is a bijection on $I$, since $x \neq y$ by our choice.
A: If (1/3, 2/3) is a proper subset of (a, b), then use the identity map.
Otherwise, divide the domain interval (a, b) into two parts, mapping the first part onto (a, b) using scaling, and mapping the second part onto (1/3, 2/3) - (a, b) using scaling and translation.
