Let $f(x):[a,b]\longrightarrow \mathbb{R}^n$ be injective and continuously differentiable curve. Then the arc length is given by $$\int_a^b |f'(t)|dt$$.
What will be the arc length formula if $\mathbb R^n$ is replaced by a metric space $(X,d)$. I found the definition of metric derivative here. Is the arc length formula given by $$\int_a^b \lim_{s\to0}\frac{d(f(t+s),f(t)}{|s|}dt$$, if the limit and integral exists? Does it make sense at all?
Assume that $\gamma\colon [a,b] \to (X,d)$ is a continuous path. Its length is, by definition, $$ \ell(\gamma) = \sup_{n\geqslant 0}\sup_{a = t_0\leqslant \cdots \leqslant t_n = b}\sum_{i=0}^{n-1}d(\gamma(t_{i+1}),\gamma(t_i)) $$ and $\gamma$ is called rectifiable if $\ell(\gamma) < + \infty$. It can be shown that this coincides with $\int_a^b \|\gamma'\|$ when $\gamma$ is a piecewise-$\mathcal{C}^1$ curve in $\Bbb R^n$ (or in a Riemannian manifold). More generally, it can be shown that if $\gamma$ is sufficiently nice (locally-Lipschitz for instance), then $|\gamma'|(t) := \lim_{s\to 0} \frac{d(\gamma(t+s),\gamma(t))}{|s|}$ is defined almost everywhere and that $\ell(\gamma) = \int_a^b|\gamma'|$ in the Lebesgue sense.
Note that this yields a new distance on $X$, called the intrinsic distance, by $$ \bar{d}(x,y) = \inf_{\gamma\colon x\to y} \ell(\gamma) $$ where the supremum is taken over all rectifiable curves $\gamma$ joining $x$ to $y$. In general, one only has $d \leqslant \bar{d}$, and the equality often fails to be satisfied. A metric space satisfying $\bar{d}=d$ is called a path-metric space. Ultimately, if for any two points $x$ and $y$, there exists a path $\gamma$ realizing the distance between $x$ and $y$, $(X,d)$ is called a geodesic metric space.