Suppose that $f:[a,b]\rightarrow\mathbb{R}$ is bounded by an $M>0$ and there exist points $a=x_0<x_1<\ldots<x_N=b$ such that $f|_{[x_{j-1},x_j)}$ is monotone for $j=1,\ldots,N$. I want to show that $f\in BV([a,b])$.
My attempt: denote $I_j=[x_{j-1},x_j)$ and $\Omega(f,I_j)=\sup\{|f(x)-f(y)|:x,y\in I_j\}$. Let $P=\{a=a_0<a_1<\ldots<a_m=b\}$ be a partition. Suppose that $a_0,\ldots,a_{j_1}\in I_1$, $a_{j_1+1},\ldots,a_{j_2}\in I_2$, $\ldots$ , $a_{j_{N-1}+1},\ldots,a_m=a_{j_N}\in I_N$. Then $$ \sum_{i=1}^m|f(a_j)-f(a_{j-1})|\underbrace{\leq}_{\substack{\text{monotone} \\ \text{in $I_i$}}} \sum_{i=1}^N\Omega(f,I_i)+\sum_{i=1}^N |f(x_{j_i+1})-f(x_{j_i})|\leq \sum_{i=1}^N\Omega(f,I_i)+2MN=C. $$
Is this correct?