How many points can I prescribe for a diffeomorphism of the plane? I was trying to find out how to construct a $\mathcal C^\infty$ curve that joins two arbitrary line segments. My idea was to use bump functions and the likes, but for that I had to make the line segments lie at $y = 0$ and $y = 1$. Of course, the transformation that transported the segments would have to be a diffeomorphism (at least of some set containing the segments). This I readily found to be equivalent to prescribing the image of four points under some diffeomorphism. A couple ways of doing this occurred to me, but I encountered this question in the process.
What restrictions are there on the cardinal of a set A\subset\Bbb R^2 such that there exists a (auto) diffeomorphism f with f(A) = B for some fixed $B\subset \Bbb R^2? (Obviously #B = # A)
In light of developments, I'll ask for which homeomorphic $A,B\subset\Bbb R^2$ is there a diffeomorphism of $\Bbb R^2$ (or an open set containing $A$,$B$) sending $A$ to $B$?
If $\#A<\infty$ there always exists such an $f$, constructed by appropriate polynomials. (e.g. $f(x,y) = (ax^2+bxy+cy^2,a'x^2+b'xy+c'y^2)$ allows for six points, and so on.
My intuitive guess is that we can do the same for a countable set, but I couldn't justify it myself. For uncountable it seems obvious that the answer is negative in general. Along with an answer for the countable case, I'd like to know if possible of some other examples, possibly more elegant, for the finite case.
Also optional: how does the answer to this question (in a manifold) relate to the geometry of the manifold?
 A: The questions you ask have a very wide scope, so I will just give some examples. If diffeomorphism is replaced with homeomorphism, problems like this have a long history with the most famous being the Jordan-Schoenflies problem. Daverman's book Decompostions of Manifolds is a good source for this material, though really this question probably spans all of geometric topology.
The density of $A$ and $B$ in $\Bbb R^2$ and the homeomorphism type of $A$ and $B$ give some obvious invariants of finding a homeomorphism of $\Bbb R^2$ sending $A$ to $B$ (i.e. Hagen's answer). Sometimes these are enough. In fact, it is true that for every subset of the plane $C$ homeomorphic to the Cantor set, there is a homeomorphism of $\Bbb R^2$ which sends $C$ to the standard Cantor set. In $\Bbb R^3$, things become much more complicated. There are sets homeomorphic to Cantor sets (see Antoine's necklace) where there exists no such homeomorphism. 
Also in $\Bbb R^3$, we can ask when can whether or not there exists such a diffeomorphism for a pair of smoothly-embedded circles $K_1, K_2$. Gordon and Luecke showed this is true whenever $\Bbb R^3-K_1$ and $\Bbb R^3-K_2$ are homeomorphic, and in one dimension higher there are some wide open questions i.e.

Open Question: Let $S_1,S_2\subset \Bbb R^4$ be smoothly embedded 2-spheres one of which is the standard $S^2\subset \Bbb R^3 \times 0$. If there is a homeomorphism of $\Bbb R^4$ sending $S_1$ to $S_2$ is there a diffeomorphism of $\Bbb R^4$ sending $S_1$ to $S_2$?

A: If $A$ and $B$ are countably infinite, it may happen that there isn't even a continuous map $A\to B$, hence no extension to a diffeomorphism $\mathbb R^2\to\mathbb R^2$ is possible:
Let $A=\mathbb Q\times\mathbb Q$ amd $B=\mathbb Z\times\mathbb Z$. 
A: As Hagen von Eitzen's already pointed out, there are topological obstructions. Here's a one-dimensional example: take $A=\left\{0, \frac{1}{n}\ :\ n\ge 1\right\}$ and $B=\mathbb{Z}$. Since $A$ is compact you cannot continuously map it onto $B$. 
It would be nice to know if topological obstructions are the only obstructions. That is, if one already knows that there exists a homeomorphism mapping $A$ onto $B$, can one conclude that there exists a diffeomorphism mapping $A$ onto $B$? (My guess is that the answer is positive). 
A: The following extends Hagen's answer.
Clearly, imposing requirements on the cardinality is not enough. A necessary condition for a diffeomorphism as desired to exist is that $A$ and $B$ are homeomorphic as subspaces of $\mathbb{R}^2$. If one of the sets happens to be a smooth submanifold, the other one has to be too, and they need to be diffeomorphic. 
