An example of a continuous function $f:\mathbb{R}\to\mathbb{R}$ whose graph is a rectifiable curve, and which is not piecewise smooth After these questions one and two and three, I'd like to know an example of a continuous function $f:\mathbb{R}\to\mathbb{R}$ which is not piecewise smooth, but $(x,f(x))$ being a rectifiable curve in any open interval in its domain.
I'd appreciate some help in form of hints, suggestions if not answers.
Added :
The functions of the class mentioned in this question seem to be suitable examples for the above question. A construction method for functions of this type is given by Pietro Majer in this answer. Also note that (as mentioned in the comments by Pietro Majer there) the description of this class can be extended to any countable dense subset instead of the Rationals.
I'd like to know whether this class of functions are the only examples for the type of functions mentioned in this question.
 A: Consider the sawtooth functions
$$\phi_n(x):=\min\bigl\{|x-{k\over2^n}|\>\bigm| \>k\in{\mathbb Z}\bigr\}\qquad(x\in{\mathbb R})\ .$$
Each $\phi_n$ takes values in $[0,2^{-(n+1)}]$, is Lipschitz continuous with Lipschitz constant $1$ and has "corners" at the points $k\>2^{-(n+1)}$, $k\in{\mathbb Z}$.
The function
$$f(x):=\sum_{j=0}^\infty\>{1\over 4^j}\phi_j(x)\qquad(x\in{\mathbb R})$$
is therefore well defined and continuous on all of ${\mathbb R}$, and its total variation on any interval $[a,b]\subset{\mathbb R}$ can be estimated as follows:
$$V_{[a,b]}(f)\leq \sum_{j=0}^\infty {1\over 4^j}(b-a)={4\over3}(b-a)\ .$$
Therefore any finite part of the graph of $f$ is rectifiable. 
It remains to show that $f$ is not piecewise smooth. To this end consider a point $(2k+1)/2^{n+1}$. The functions $\phi_j$ with $j<n$ are linear in the neighborhood of this point, $\phi_n$ changes its derivative from $1$ to $-1$ there, and because of the factors ${1\over 4^j}$ in the definition of $f$ the summands with $j>n$ cannot smooth out this corner.
