# Combined length of portions of a line segment

Suppose I have a continuous function $f : X \to \mathbb{R}^n$ (where $X \subseteq \mathbb{R}^n$) that is piecewise rigid, i.e. $X$ has a finite partition $\mathcal{P}$ such that for all $P \in \mathcal{P}$, $f|_P$ is the restriction of a rigid transformation $\mathbb{R}^n \to \mathbb{R}^n$. I'm trying to prove that $f$ preserves the length of geodesics (line segments), but are the above conditions sufficient?

Here is my approach: given a line segment $L \subseteq X$, $\mathcal{L} = \{P \cap L\ |\ P \in \mathcal{P}, P \cap L \neq \emptyset\}$ is a finite partition of $L$. $f$ must map each element of $\mathcal{L}$ isometrically, so the combined length of that element is preserved. Hence, \begin{align} (\text{length of }f(L)) &= \sum_{L' \in \mathcal{L}}f|_{L'}(\text{combined length of }L')\\ &= \sum_{L' \in \mathcal{L}}(\text{combined length of }L')\\ &= (\text{length of }L). \end{align}

How do I make this argument rigorous? Do I need measure theory? The problem is that each $L'$ has many connected components; it is entirely possible for me to restrict $f$ such that each $L'$ has a finite number of connected components, but I would like to avoid that as much as possible - because that assumption would actually be a consequence of what I'm trying to prove!

-
Do you mean $f: \mathbb{R}^n \rightarrow \mathbb{R}^n$ instead of $X$? – Calvin Lin Jan 30 '13 at 23:42
Sorry, I meant that $X \subseteq \mathbb{R}^n$. – Herng Yi Jan 31 '13 at 1:28