Let me outline a proof; I shall leave the details of this proof as exercises.
Exercise 1: Prove that the unit circle $S^1$ is homeomorphic to the space obtained from the unit interval $[0,1]$ by identifying the endpoints $0$ and $1$. (Hint: the exponential mapping $\theta\to e^{i\theta}$ can be composed with a linear mapping to give a homeomorphism.)
Let $C$ be the image of a simple closed curve in the plane, that is, let $C$ be the image of a continuous function $f:[0,1]\to \mathbb{R}^2$ such that $f:(0,1)\to\mathbb{R}^2$ is injective and $f(0)=f(1)$.
Exercise 2: Prove that $C$ is homeomorphic to the unit circle $S^1$. (Hint: show that $f:[0,1]\to C$ induces a continuous bijection $\tilde{f}:S^1\to C$ using Exercise 1 and then show that $f$ is an open mapping using the compactness of $S^1$ and the fact that the plane is Hausdorff.)
We now need an elementary lemma of point-set topology:
Exercise 3: Let $X$ be a topological space and let $X=A\cup B$ where $A$ and $B$ are closed subspaces of $X$. Prove that if $g:A\to Y$ and $h:B\to Y$ are continuous functions into a topological space $Y$ such that $g(x)=h(x)$ for all $x\in A\cap B$, then there is a unique continuous function $f:X\to Y$ such that $f(a)=g(a)$ and $f(b)=h(b)$ for all $a\in A$ and $b\in B$.
Finally, we can prove the result of your question:
Exercise 4: Prove that the unit square is the image of a simple closed curve in the plane and conclude that it is homeomorphic to the unit circle. (Hint: you can use Exercise 3 to "glue" continuous mappings together.)
Exercise 5: Give examples of images of simple closed curves in the plane (using Exercise 3) and conclude (using Exercise 2) that they are homeomorphic to the unit circle $S^1$.
I hope this helps!
As pointed out in the comments on the MO question, this follows immediately from a 1931 theorem of M.H.A. Newman, which is Theorem 2 in this paper. Notice that Theorem 2 is basically a lemma (used to prove the main theorem 1) whose proof takes two pages, and uses nothing other than definition of manifold.
Best Answer
It looks as if it works, yes. But you can just take $f(x,y)=x$ too.