It is injective because if $g(s)=g(t)$, $s<t$, then you can remove the interval $[s,t]$ from the domain of definition of $g$ and make the curve shorter. Then you rescale the domain to be $[0,1]$. Rescaling does not change the length of the curve. See also Lemma 3.10 in my notes linked to the answer to another related question: Does there always exists a path $g:[0,1] \rightarrow X$ from $f(0)$ to $f(1)$ that has the same image as $f$ and …?