I posted this on the new math.SE website but didn't get much of a response, so I am reposting it here.

Suppose $f$ is a continuous $\mathbb{R}$-valued function on $\mathbb{R}^n$. What type of conditions on $f$ guarantee it is a polynomial up to homeomorphism. That is, when can I find a homeomorphism $\phi:\mathbb{R}^n \to \mathbb{R}^n$ such that $\phi^* f = f \circ \phi \in \mathbb{R}[x_1,\ldots, x_n]$?

Some related questions:

- A necessary condition in the case of $n = 1$ is that point inverse images of $f$ must be finite (since a polynomial has only finitely many roots). Is this sufficient?
- What if we replace $\mathbb{R}$ by $\mathbb{C}$?
- What if we look at smooth functions and diffeomorphism instead? (I tried playing around with the implicit function theorem but didn't get anywhere).
- What about the complex analytic case?

I'm not quite sure how to tag this, so feel free to edit them.