Let f be a bounded real valued function on [a,b], then define the length of the curve L(f) as follows: \begin{equation}\tag{1} L(f)=sup\sum\limits_{i=1}^{n}\sqrt{ (x_i-x_{i-1})^2+(f(x_i)-f(x_{i-1}))^2}, \end{equation} where sup is taken over all partitions of [a,b].
The question is to show, L(f) is equal to \begin{equation}\tag{2} \lim\limits_{max|x_i-x_{i-1}|\to 0}\sum\limits_{i=1}^{n}\sqrt {(x_i-x_{i-1})^2+(f(x_i)-f(x_{i-1}))^2} \end{equation} for continuous functions. I know when $max|x_i-x_{i-1}|\to 0$, we get finer partitions so that $(1)\leq(2)$ because if we pick any partition and then let $max|x_i-x_{i-1}|\to0$ then we get a greater sum due to triangle inequality.(I guess what I said is true and does not require continuity.) I could not show $(2)\leq(1)$ and could not use the continuity. In a finite sum, we can switch $\sum$ and limit but as $max|x_i-x_{i-1}|\to0$ we get an infinite sum so switching may fail. I got stuck.
P.S. I have read (Determining the Length of a Curve Using Partitions) but I did not understand "there is a sequence $(Q_n)_{n\geq0}$ of partitions with (3) holds" which was stated in the answer. If you refer to that question, please tell me why (3) holds. I thought that (3) is the same as what we want to show in that question.
Probably, I missed an easy detail. Thanks in advance for any help.