Is it true that a space-filling curve cannot be injective everywhere?

Here, it is said that a space-filling curve cannot be injective because "that will make the curve a homeomorphism from the unit interval onto the unit square", since every continuous bijection from a compact space to a Hausdorff space is a homeomorphism.

That does mean there can be no injective mapping from $[0,1]$ onto $[0,1]\!\times\![0,1]$, but it doesn't really tell us anything about mappings from noncompact intervals onto the unit square. In the case of the ordinary Peano-Hilbert curve, it does not help much: the construction has infinitely (only countably, though) many inherent points of overlap (discussed here: In what way is the Peano curve not one-to-one with $[0,1]^2$? ), but I can't really see any reason why there could not be a space-filling curve without such points. Of course, the curve's inverse could not be continuous, but when mapping from a noncompact interval it wouldn't need to be! After all, there are other curves mapping noncompact spaces bijectively to compact ones in a continuous way, but with noncontinuous inverse, like the obvious $[0,2\pi[\to S^1$.


There are no continuous bijections from $\mathbb{R}$ to $\mathbb{R}^2$, or to $[0,1]^2$.

Suppose $f$ is a continuous injection from $\mathbb{R}$ into $\mathbb{R}^2$. Then for each $n \in \mathbb{N}$, $f|_{[-n,n]}$ is a continuous injection from a compact space to a Hausdorff space, and hence a homeomorphism onto its image. Thus the image $f([-n,n])$ is nowhere dense: it's compact, hence closed, hence if it were somewhere dense it would contain a closed ball. But then there would be infinitely many points that could be deleted from it without disconnecting it, contradicting it being homeomorphic to $[-n,n]$.

Thus the image of $f$ is a countable union of nowhere-dense sets. So by the Baire category theorem it can't be all of $\mathbb{R}^2$, or indeed any set with nonempty interior.


A proof of "No continuous bijection for $[0, 1]$ and $[0, 1]^2$":

Let $f$ be a continuous bijection from $[0, 1]$ to $[0, 1]^2$, $x \in [0, 1]$

$A = [0, 1] - x$, $B = [0, 1]^2 - f(x)$

A is not path-connected but B is, which leads to a contradiction.