Is it possible to construct a continuous and bijective map from $\mathbb{R}^n$ to $[0,1]$? Let $U$ be a non-trivial finite-dimensional vector space over $\mathbb R.$ I am trying to use a bijective and continuous map $f: U \to [0,1]$ and $d(x,y)=|f(x)-f(y)|$ to prove that there exist a metric on $U$ that makes $U$ compact. However, I couldn't find such continuous and bijective map: $f:U\to[0,1] \text{ (or $[0,1]^n$).}$ Is there any example? Or is there any other way to prove there exists a metric on $U$ that makes $U$ compact?
Edited: Thank you for all of your comments. I just started to learn compactness these days so I am not very good at some of the concepts. Now I understand that there is no need to construct a continuous map to prove the compactness. I also know that there does not exist a norm on U which makes U compact. My question is: how to prove there does exist a metric on U which makes U compact?
 A: To answer the question in the title: No for $n>1$.
If $f:\mathbb R^n\to[0,1]$ is continuous and surjective then $f^{-1}([0,\frac12))$ is a proper clopen subset of $f^{-1}([0,1]\setminus\frac12)$. That means $f^{-1}([0,1]\setminus\frac12)$ is disconnected. But $\mathbb R^n$ minus a single point is connected, so $f$ must not be injective.
A: To complete the answer of Chris Culter: this is also impossible for $n=1$. Suppose $f:\Bbb{R}\to [0,1]$ is continuous and bijective, and let $x\in \Bbb{R}$ be such that $f(x)=0$. Consider $f([x,\infty))$; since $f$ is continuous, this is a connected subset of $[0,1]$ which contains $0$, and so there is some $r_1>0$ such that $[0,r_1]\subseteq f([x,\infty)$. Similarly, there is $r_2>0$ such that $[0,r_2]\subseteq f((\infty,x])$. Take $r>0$ such that $r<\min\{r_1,r_2\}$. Then $r$ is both in $f((\infty,x])$ and in $f([x,\infty)$. Since $f$ is bijective, we know $f(x)\neq r$, so we arrive at a contradiction: $r$ is both the image under $f$ of some number larger than $x$ and some number smaller than $x$.
EDIT. In fact, now that I think about it, the same proof works for every $n$ - just take, instead of $[x,\infty)$ and $(\infty,x]$, any two connected subsets $A,B$ of $\Bbb{R}^n$ which both contain $x$ and such that $A\cap B=\{x\}$.
A: The proof suggested by David Hartley here also works in this case, and I think it's worth noting here.
This proof is significantly cooler than the previous ones, because it proves something much stronger: If $X$ is a path-connected topological space admitting a continuous bijection $f:X\to [0,1]$, then $f$ is a homeomorphism. In particular, $X$ cannot be $\Bbb{R}^n$, because $\Bbb{R}^n$ is not homeomorphic to $[0,1]$.
Proof. Suppose $X$ is a path-connected space and that $f:X\to [0,1]$ is a continuous bijection. Let $\phi:[0,1]\to X$ be a path from $f^{-1}(0)$ to $f^{-1}(1)$. Composing $\phi$ with $f$, we get a path from $0$ to $1$ in $[0,1]$; therefore, $f\circ\phi:[0,1]\to [0,1]$  is surjective, and hence so is $\phi:[0,1]\to X$. Therefore $X$ is compact. Since $[0,1]$ is Hausdorff, this means $f$ is a closed map, and hence a homeomorphism.
