TITLE: Patching together homeomorphisms: how badly can it fail?
QUESTION [8 upvotes]: Suppose we have a set $X$ with $X=U \cup V$. If we pick a permutation $f$ of $U$ and a permutation $g$ of $V$ which agree on the intersection $U \cap V$, we can coalesce them into one big endo-map $F$ of $X$. In general, of course, $F$ is no longer a permutation - we can only say that it is onto. A counter-example is fun to think of - for example, if $X$ is finite, then $F$ is always a permutation.
Now let $X, U$  and $V$ be open subsets of $\Bbb{R}^n$, and suppose $f$ and $g$ are smooth homeomorphisms. I have been unable to come up with a single example for which the above patching fails "badly", say for which the set of points $x$ having more than one pre-image had positive measure. 
I'd love to know if anyone knows anything related to this problem, or could provide a counter-example. Thank you!

REPLY [3 votes]: The set of points having more than one pre-image is open (so it always has positive measure if it is non-empty). It follows that $U \cap V$ must be disconnected and in fact it has to have infinitely many connected components. However there are examples in $\mathbb{R}^2$ where both $U$ and $V$ are connected:
For a negative integer $n$ we define the real intervals $$I_n=(2n-\frac{1}{3},2n+\frac{1}{3}) \mbox{ ;  } J_n=(2n+\frac{2}{3},2n+\frac{4}{3}).$$ For a non-negative integer $n$ we let $$I_n=J_n=(n-\frac{1}{3},n+\frac{1}{3}).$$ 
Let $f$ and $g$ be two increasing (smooth if you wish) homeomorphisms from $\mathbb{R}$ onto $\mathbb{R}$ such that $f[I_n]=I_{n+1}$ and $g[J_n]=J_{n+1}$ for all $n \in \mathbb{Z}$. Let $I=\bigcup_{n\in \mathbb{Z}}I_n$ and $J=\bigcup_{n\in \mathbb{Z}}J_n$. 
Now in $\mathbb{R}^2$ we define the open sets $$U=I \times (-1, \infty) \cup \mathbb{R} \times (2,\infty)$$ $$V=J \times (-\infty, 1) \cup \mathbb{R} \times (-\infty ,-2).$$ 
Finally we let $F=f \times id$ and $G=g \times id$ be the autohomeomorphisms of $U$ and $V$ respectively. The set of points with two pre-images is precisely $I_0 \times (-1,1)$.
Similar examples exist in $\mathbb{R}^n$ for $n\geq3$, but of course in $\mathbb{R}$ we cannot get $U,V$ to be connected.