This is a standard result that every rectifiable curve in a metric space admits an arc length parametrization. The proof can be found in many sources. For examples Theorem 3.2 in theseHajłasz - Sobolev spaces on metric-measure spaces notes. Then the arc-length parametrization is defined on $[0,L]$ and a linear change of variables leads us to $g$ defined on $[0,1]$.