Q:

Why can the continuous function of a non compact set be compact

for example: $S_1=\{(x,y)\in \mathbb{R}^2: x^2+y^2\leq 1,\ x,y,\geq 0\} \\ S_2=\{(x,y)\in \mathbb{R}^2: x^2+y^2 < 1,\ x,y,\geq 0\}$
Why is $f(S_2) = S_1$ possible but $f(S_1) = S_2$ isn't?
I'm using the definition of compactness from Bolzano-Weierstrass
theorem
What is the criteria for the existence of such function?
What is the general way of finding such continuous function if it exist?

A:

An example of a continuous function $f$ such that $f(S_2)=S_1$ is $f(x,y) =\sin^{2}(2\pi (x^{2}+y^{2})) (u,v)$ for $(x,y) \neq (0,0)$, $f(0,0)=0$ where $u=\frac x {\sqrt {x^{2}+y^{2}}}$ and $v=\frac y {\sqrt {x^{2}+y^{2}}}$. There is no continuous function $f$ such that $f(S_1)=S_2$ because continuous image of  a compact set is compact. 

