Does there exist a diffeomorphism on $\mathbb{R^2}$ that flattens out the boundary of a compact set at a point? Given a compact subset of $\mathbb{R^2}$ with ${C^2}$ boundary $S$ and a point $x \in S$, can one find a diffeomorphism $f$ from $\mathbb{R^2}$ to $\mathbb{R^2}$ for which $f(x) = x$, the image $f(S)$ is a ${C^2}$ curve and such that, in a neighborhood of $f(x)$, the curve $f(S)$ coincides with the tangent line of $x$ in $S$?
I think this is possible but still have no idea how to construct such a function $f$.
 A: If by a diffeomorphism you mean a smooth map with smooth inverse the answer is no in general. If you can find such a diffeomorphism it would follow that $S$ is actually smooth in a neighborhood of $x$ not just $\mathcal C^2$ as you have constructed a smooth local submanifold chart of $S$ near $x$. 
If otherwise you are satisfied with a $\mathcal C^2$ map having a $\mathcal C^2$ inverse the answer is yes:
You may without loss of generality assume that $x = 0$ and choose some $\epsilon > 0$ such that $B_\epsilon(0) \cap S$ is a graph of some $\mathcal C^2$ function $f$. Choose a $\mathcal C^2$ function $g$ which coincides with $f$ on some intervall $]-\delta,\delta[$ and consider its graph $\{(g(y),y) \in \mathbb R^2 | y \in \mathbb R\}$. Then you may define your desired function via $\phi(x,y) = (g(y) + r,y) \mapsto (r,y)$. That this is indeed a $\mathcal C^2$ map with $\mathcal C^2$ inverse is clear since $h(x,y) := (g(y) + x,y)$ defines such a map and $\phi = h^{-1}$.
A: By a diffeomorphism, I mean a function $f$ for which both $f$ and $f^{-1}$ are differentiable (can be approximated by a linear map). 
I think your answer is going in a right direction.  It's just that the function $\phi$ might affect the boundary on the other side(s).  We will have to define $\phi$ to be identity map outside a region, possibly $B_\epsilon(0)$, and choose a function $r$ (instead of a constant $r$) so that $\phi$ is still $C^2$.  Thank you.
