Every path has a simple "subpath"

Solution 1:

It suffices to show that $Y$ is arcwise connected, since a homeomorphism $g:[0,1]\to Y$ such that $g(0)=f(0)$ and $g(1)=f(1)$ is certainly injective.

The Hahn-Mazurkiewicz theorem says that a Hausdorff space is the continuous image of the closed unit interval iff it is a compact, connected, locally connected metric space; such spaces are sometimes called Peano spaces. Clearly $Y$ is a Peano space. The result is therefore immediate from the theorem that every Peano space is arcwise connected. This is Theorem 31.2 in Stephen Willard, General Topology; the proof is non-trivial but not hard to follow.

You may be able to see most of it at Google Books, if you you’re allowed to read the page 220 result here. The missing lines from page 219 (including the end of the sentence from p. 220) are:

Suppose $a$ and $b$ are points in a Peano space $X$. Using Theorem 26.15, there is a simple chain $U_{11},\dots,U_{1n}$ of open connected sets of diameter $<1$ from $a$ to $b$.