question on homeomorphisms of $\mathbb{R}^2$ Let $R$ be the set of rectangles with sides parallel to axes.
Let $h$ be a homeomorphism of $\mathbb{R}^2$ such that $h(r)\in R$ for any $r\in R$.
Does it imply that $h(x,y)=(f(x),g(y))$ or $h(x,y)=(g(y),f(x))$ for $f,g$ being homeomorphisms of $\mathbb{R}$?
 A: Let $h\colon\mathbb{R}^2\to\mathbb{R}^2$ be a homeomorphism that preserves $R$. Observe that we can characterise straight line segments as intersections of rectangles: If we have a straight line segment $L$ parallel to one of the axes, then there are $r,r'\in R$ such that their interiors are disjoint and their intersection is $L$. On the other hand every such intersection is either a point or a straight line segment. Since $h$ preserves $R$ and is a homeomorphism, it also preserves line segments parallel to one of the axes.
Now let $h\colon\mathbb{R}^2\to\mathbb{R}^2$ be a map that preserves lines parallel to the $y$-axis. Then there is a map $f\colon\mathbb{R}\to\mathbb{R}$ such that the $x$-coordinate of $h$ is given by
$f(x)$, that is $h(x,y)=(f(x),y')$ for some $y'$. This is just a reformulation of what it means to preserve lines parallel to the $y$-axis.
In conclusion, up to switching the $x$ and $y$ axis, we may assume that $h$ preserves lines parallel to both axes seperately. Then by the above, there are maps $f$ and $g$ that give the $x$ and $y$ coordinate of $h$, i.e. $h(x,y)=(f(x),g(y))$.
In the other case we get that $h(x,y)=(f(y),g(x))$.
