Lower semicontinuity of length of graph: $L(g)\le\liminf_{n\to\infty}L(f_n)$ I am interested in the following claim:$\newcommand{\intrv}[2]{[#1,#2]}\newcommand{\limti}[1]{\lim\limits_{#1\to\infty}}$

Let $g,f_1,f_2,\dots$ be continuous functions on $\intrv ab$ such that $g=\limti n f_n$, i.e., $g$ is pointwise limit of the sequence $(f_n)$. Then $$L(g)\le\liminf\limits_{n\to\infty}L(f_n),$$
  where $L(g)$ denotes the length of the graph of the function $g$.

Main question: I am mainly interested in the words continuous and pointwise which I stressed above. Is the continuity of the functions $f_n$ and of the limit function $g$ needed, or can it be omitted? Do we need uniform convergence, or is pointwise convergence sufficient?
However, I would be also glad to see various proofs of this claim or its versions. (Or counterexamples showing that some assumptions cannot be omitted.) References to texts where this result or variations thereof are shown are welcome, too.
Maybe it is also worth mentioning that the inequality can be strict. An example showing this can be found in an answer to this question. And this question is basically about another example of the same type: Is value of $\pi = 4$?

Source of the problem.
I stumbled upon this problem in the book van Rooij, Schikhof: A Second Course on Real Functions, where Exercise 21.R reads:

Let $g,f_1,f_2,\dots$ be continuous functions on $\intrv ab$ such that $g=\limti n f_n$. Show that $L(g)\le\liminf\limits_{n\to\infty}L(f_n)$.

Although it does not explicitly say that the convergence is pointwise, as far as I remember in other places in this book the authors specifically say that the convergence is uniform, when talking about uniformly convergent sequences.
I tried to solve this problem. (I am posting my attempt as an answer below.) It surprised me that I did not use continuity of the functions in my proof, and it is explicitly stated as one of the assumptions. Another thing which made me suspicious was that I found similar claims in other books stated with uniform convergence instead of pointwise convergence. (EDIT: Finally I was able to find at least one text which states this result with pointwise convergence. See the reference to Penot's book I have added below.) So I decided to post a question here in the hope that I will get some information saying in what generality this claim can be proved.

Definition of length.
The definition of length of the graph used in this book is the following:

Let $P \colon a=x_0 < x_1 < \dots < x_k = b$ be a partition of $\intrv ab$. Then we define for a function $f\colon\intrv ab\to \mathbb R$
  $$L_p(f) := \sum_{i=1}^n \sqrt{(x_i-x_{i-1})^2+(f(x_i)-f(x_{i-1}))^2}.$$
The length of the graph of $f$ is by definition
  $$L(f):=\sup\{L_P(f) \colon P\text{ is a partition of }\intrv ab\}$$

Notice that $L(f)$ is defined for any function $f\colon\intrv ab\to \mathbb R$, but it may be $\infty$.
It is also known that $L(f)$ is finite if and only if $f$ has bounded variation.
In other words, any partition $P$ determines some points on the graph, which define a piecewise linear function. The length of this piecewise linear curve is denoted by $L_P(f)$. We then take the supremum over all possible partitions.

Other references for similar claims.
A natural way to clarify my doubts was to search in literature for other occurrences of the same result and trying to find out what assumptions are used there.
In the book Andrew Browder: Mathematical analysis. An introduction (Springer, 1995), page 159, I found the following result.

7.8 Theorem. If $f_k\in\mathscr P$ for each $k\in\mathbb N$ and $(f_k)$ converges uniformly to $f$, then $L(f)\le\liminf L(f_k)$.

There are two differences compared to the above claim. One is that this book works with functions into arbitrary metric space $X$ rather than functions into $\mathbb R$. The other one is that uniform convergence is assumed instead of pointwise convergence.
In the book Mariano Giaquinta, Giuseppe Modica: Mathematical analysis: linear and metric structures and continuity, page 396 I found this result:

11.2 Theorem (Semicontinuity). The length functional $L(\varphi)$ is lower semicontinuous in $C^0(\intrv ab, X)$.

The basic idea of the proof is the same as in my answer below: Using the fact that supremum of a set of lower semicontinuous functions is lower semicontinuous.
Here $X$ is again a metric space and $C^0(\intrv ab, X)$ is endowed with sup-norm.
In fact I have quoted this very theorem from this book in an answer to another question, which asked about this results specifically for differentiable functions.

EDIT: I have searched a bit more and I managed to find that Exercise 1.1.3 in the book Jean-Paul Penot: Calculus without derivatives (Springer, 2013) states this fact with pointwise convergence and gives as a hint basically the same proof I have posted below. I will quote both the part where the length is defined and the exercise about lower semicontinuity.
The following is given on page 16 as one of the examples of lower semicontinuous function:

Example: The length function. Given a metric space $(M,d)$, let $X:=C(T,M)$ be the space of continuous maps from $T:=[0,1]$ to $M$. Given a finite subdivision $\sigma:=\{t_0=0<t_1<\dots<t_n=1\}$ of $T$, let us set for $x\in X$,
  $$\ell_\sigma(x):= \sum_{i=1}^n d(x(t_{i-1}),x(t_i)),$$
  and let $\ell(x)$ be the supremum of $\ell_\sigma$ as $\sigma$ varies in the set of finite subdivisions of $T$. The properties devised below yield that $\ell$ is lower semicontinuous when $X$ is endowed with the topology of pointwise convergence (and a fortiori, when $X$ is endowed with the metric of uniform convergence). However, $\ell$ is not continuous: one can increase $\ell$ by following a nearby curve that makes many small changes (a fact that every dog knows when tied with a leash). Details are given in Exercise 3 below.

In the same chapter the following exercise is given on page 20:


  
*Let $(M,d)$ be a metric space, let $T:=[0,1]$, and let $X:=C(T,M)$ be the set of continuous maps from $T$ to $M$. 
  Given some $x\in X$ and some element $s$ of the set $S$ of nondecreasing sequences $s:=(s_n)_{n\ge0}$ satisfying $s_0=0$, $s_n=1$ for $n$ large, let
  $$\ell_s(x):= \sum_{n\ge0} d(x(s_n),x(s_{n+1}))$$
  (observe that the preceding sum contains only a finite number of nonzero terms).
  Define the lenght of a curve $x\in X$ by $\ell(x):=\sup_{s\in S}\ell_s(x)$. Show that $\ell_s \colon X\to\mathbb R$ is continuous when $X$ is endowed with the metric of uniform convergence (and even when $X$ is provided with the topology of pointwise convergence). Conclude that the length $\ell$ is a lower semicontinuous function on $X$.
  

The second part of this exercise asks for proof that $\ell$ is not continuous. This is done using a very similar example to the one I linked above.
 A: I will write down two versions of my attempt to prove the above claim. Both are based on the same idea. (It is more-or-less the same proof, written down from a slightly different perspective.)$\newcommand{\intrv}[2]{[#1,#2]}\newcommand{\limti}[1]{\lim\limits_{#1\to\infty}}$

Let $\Delta$ denotes the set of all partitions of the interval $\intrv ab$.
Observation. Let us fix some partition $P\in\Delta$ given by the points $a=x_0 < x_1 < \dots < x_k=b$. Then the function
$$\varphi_P \colon (y_0,\dots,y_k) \mapsto \sum_{i=1}^k \sqrt{(x_i-x_{i-1})^2+(y_i-y_{i-1})^2}$$
from $\mathbb R^{k+1}$ to $\mathbb R$ is continuous and $L_P(f)$ is obtained by plugging the values $(f(x_0),\dots,f(x_k))$ into this function.
Elementary version
Using the above observation we get that $\limti n L_P(f_n) = L_P(g)$ holds for any partition $P\in\Delta$.
By definition,
$$L(g) = \sup_{P\in\Delta} L_P(g)$$
which implies that
$$(\forall \varepsilon>0) (\exists P\in\Delta) L(g)-\varepsilon < L_P(g)$$
Now if we use that $\limti n L_P(f_n) = L_P(g)$, then we get
$$(\forall \varepsilon>0) (\exists P\in\Delta) (\exists n_0) (\forall n\ge n_0) L(g)-\varepsilon < L_P(f_n).$$
But we also have $L_P(f_n) \le L(f_n)$ for every $n$, which implies
$$(\forall \varepsilon>0) (\exists P\in\Delta) (\exists n_0) (\forall n\ge n_0) L(g)-\varepsilon < L(f_n).$$
But since neither of the expressions $L(g)-\varepsilon$ and $L(f_n)$ depend on $P$ we can simply write:
\begin{align*}
(\forall \varepsilon>0) (\exists n_0) (\forall n\ge n_0) L(g)-\varepsilon &< L(f_n)\\
(\forall \varepsilon>0) (\exists n_0) L(g)-\varepsilon &\le \inf_{n\ge n_0} L(f_n)\\
(\forall \varepsilon>0) L(g)-\varepsilon &\le \sup_{n_0\in\mathbb N}\inf_{n\ge n_0} L(f_n)\\
(\forall \varepsilon>0) L(g)-\varepsilon &\le \liminf_{n\to\infty} L(f_n)\\
 L(g) &\le \liminf_{n\to\infty} L(f_n)
\end{align*}
It is worth mentioning that the above proof does not deal with the case $L(f)=+\infty$. But in this case we can make very similar argument, simply replacing $L-\varepsilon$ (for arbitrary $\varepsilon>0$) by an arbitrary large real number $M$.
Using topology of the pointwise convergence
This is a different viewpoint for basically the same proof.
Let us consider the set $\mathbb R^{\intrv ab}$ of all functions from $\intrv ab$ to $\mathbb R$. (To be more precise, we should work with the functions to $\mathbb R\cup\{\infty\}$, since we allow $L(f)=\infty$.) We can endow this set with the topology of pointwise convergence, i.e., the product topology.
Now we get that (for a fixed partition $P\in\Delta$) the function $f\mapsto L_P(f)$ is continuous. (Since it is obtained from the continuous function $\varphi_P$ and the projections mapping $f\mapsto f(x_i)$.)
Now since $L(f)=\sup L_P(f)$, we get that 
$$f\mapsto L(f)$$ is a supremum of lower semicontinuous functions and therefore it is lower semicontinuous. 
Lower semicontinuity of $L$ implies that if $\limti n f_n=g$ then
$$L(g)\le\liminf\limits_{n\to\infty}L(f_n).$$
A: [This is from Prop 2.3.4 of "A Course in Metric Geometry" by Burago-Burago-Ivanov. As in the book, ${ \vert p q \vert }$ stands for ${ d(p,q) }$]
Def: Let ${ (X, d) }$ be a metric space and ${ \gamma : [a,b] \to X }$ a path. The supremum of sums ${ \Sigma (\gamma, Y) = \sum _1 ^N d(\gamma(y _{i-1}), \gamma(y _i))  }$ taken over all partitions ${Y = \lbrace a = y _0 \leq y _1 \leq \ldots \leq y _N = b \rbrace }$ is called length of ${ \gamma }$ and written ${ L _d (\gamma) }.$
Thm: Let ${ (X,d) }$ be a metric space. Then ${ L _d }$ is lower semicontinuous on ${ \mathscr{C}([a,b], X) }$ wrt pointwise convergence.
(That is, if paths ${ \gamma _j : [a,b] \to X }$ have pointwise limit ${ \gamma , }$ then ${ \liminf L _d (\gamma _j) \geq L _d (\gamma) }$)
Pf: [Case 1 : ${ L(\gamma) \lt \infty }$]
Let ${ \epsilon \gt 0 }.$ Pick a partition ${ Y = \lbrace y _0 = a \leq \ldots \leq y _N = b \rbrace }$ with ${L(\gamma) - \Sigma (\gamma, Y) }$ ${ \lt \epsilon }.$ Pick a ${ J }$ such that ${ \vert \gamma _j (y ) \gamma (y) \vert }$ ${ \lt \epsilon /N  }$ whenever ${ y \in Y },$ ${ j \geq J }.$
Now ${ L(\gamma) }$ ${ \leq \epsilon + {\color{red}{ \Sigma (\gamma, Y) } } }$ ${ = \epsilon + \sum \vert \gamma(y _{i-1}) \gamma(y _i) \vert  }$ ${ \leq \epsilon + \sum _{i=1} ^{N} \left( \vert \gamma _j (y _{i-1}) \gamma _j (y _i) \vert + 2 \epsilon /N  \right) }$ ${ = \epsilon + {\color{blue}{\Sigma (\gamma _j, Y) + 2\epsilon} }  }$ ${ \leq L (\gamma _j) + 3 \epsilon , }$ whenever ${ j \geq J }.$
So ${ L(\gamma) }$ ${ \leq \liminf L(\gamma _j) + 3 \epsilon .}$ Since ${ \epsilon \gt 0 }$ was arbitrary, ${ L(\gamma) \leq \liminf L(\gamma _j) }$ as needed.
[Case 2 : ${ L(\gamma) = \infty }$]
Let ${ \epsilon \gt 0 }.$ Pick a partition ${ Y = \lbrace y _0 = a \leq \ldots \leq y _N = b \rbrace }$ with ${ \Sigma (\gamma, Y) \gt \frac{1}{\epsilon} }.$ Pick a ${ J }$ such that ${ \vert \gamma _j (y ) \gamma (y) \vert }$ ${ \lt \epsilon /N  }$ whenever ${ y \in Y },$ ${ j \geq J }.$
Now as above, ${ L(\gamma _j) }$ ${ \geq { \color{blue}{\Sigma (\gamma _j , Y)} } }$ ${ \geq {\color{red}{\Sigma (\gamma, Y)} } {\color{blue}{- 2\epsilon}}  }$ ${ \geq \frac{1}{\epsilon} - 2 \epsilon }$ whenever ${ j \geq J }.$
So ${ L(\gamma _j) \to \infty }$ in this case, as needed.
