Example of a continuous function with discontinuous quadratic variation Let $f: [0,\infty)\to \mathbb{R}$. The quadratic variation of $f$, if it exists, is defined as the function $\langle f\rangle: [0,\infty) \to \mathbb{R}$ with 
$$  \langle f\rangle_t := \lim_{n\to \infty} \sum_{t_i \in \pi_n(t)} \left( f(t_{i+1}) - f(t_i) \right)^2  $$
for $t \in [0,\infty)$ where $\{\pi_n(t): n\in \mathbb{N}\}$ is a sequence of refining partitions of $[0,t]$.
I am looking for an example of a function $f$ such that $f$ is continuous and its quadratic variation $\langle f\rangle$ exists, but $\langle f \rangle$ is not continuous.
Motivation: In probability lecture notes, one sometimes reads (e.g. in the context of the pathwise Ito formula) that a path $X(\omega)$ is assumed to be continuous with continuous quadratic variation. Therefore, I would like to understand why it is necessary to explicitly demand the quadratic variation to be continuous if this is desired.
 A: An example is given in Appendix 5.2 of Coquet, Jakubowski, Mémin, and Słominski, Natural decomposition of processes and weak Dirichlet processes, pp. 81–116, Springer, Berlin, Heidelberg, 2006.
For completeness, I replicate the example below: we restrict ourselves to the time interval $[0,1]$. Let $f \in C[0,1]$ be defined by $f(t) = 0$ when $t = 1 - 2^{1-2p}$ and  $f(t) = \frac{1}{p}$ when $t = 1 - 2^{-2p}$, where $p \in \mathbb{Z}^+$. We complete the construction of $f$ by linearly interpolating between these points. The graph of $f$ looks like a sequence of shrinking scalene triangles as you move forward in time.
By construction, is is clear that $f$ is of bounded variation on all intervals $[0,t]$ with $t < 1$; hence its quadratic variation on those intervals vanish.
By considering the quadratic variation on $[0,1]$ along the sample points $T = \{ 1 - 2^{-2k} \, : k \geq 1 \}$, you get that this quantity is infinite.
Finally, you may construct a sequence of refining partitions of $[0,1]$, say $(\pi_n)_{n=1}^\infty$, given by:
\begin{align*}
\pi_n = \bigcup_{j \leq 2^{2n} - 1} \{j 2^{-2n}\} \cup \bigcup_{k \geq n} \{ 1 - 2^{-2k} \}
\end{align*}
You can show that along this sequence, the pathwise quadratic variation takes up its entire mass at $t=1$.
