Bounded superposition operator in the space of bounded variation functions For $n\in\mathbb N$ put $A_n:=\{k/2^n\ |\ k\in\{1,\ldots,2^n-1\}\}$. Consider $g:[0,1]\times\mathbb R\to\mathbb R$, defined by
    \begin{align*}
  g(t,u)=
  \begin{cases}
   2^{-n}\chi_{A_n}(t) & \text{for }u=2^{-n},n\in\mathbb N, \\
   0 & \text{otherwise},
  \end{cases}
 \end{align*}
where $\chi_A$ denotes the characteristic function of a set $A$, i.e $\chi_A(t)=1$ if $t\in A$ and 0 elsewhere.
This means that $g$ is zero everywhere except at the points $(k/2^n,1/2^n)$ for $k=1,\ldots,2^n-1$ where it is $1/2^n$.

I would now like to prove (or disprove) the following: For each $r>0$ there is some $M_r>0$ such that for each partition $0=t_0<\ldots<t_p=1$ ($p\in\mathbb N$) of $[0,1]$ and all $u_0,\ldots,u_p\in\mathbb R$ with $\sum_{j=1}^p|u_{j-1}-u_j|\leq r$ we have
  \begin{align}
\sum_{j=0}^p|g(t_j,u_j)|\leq M_r.\tag{1}
\end{align}

I only know that if $t_j=j/2^m$ and $u_j=1/2^m$ for all $j$ and some fixed $m\in\mathbb N$,
\begin{align*}
\sum_{j=0}^{2^m-1}|g(t_j,u_j)|=\frac{2^m-1}{2^m},
\end{align*}
and if on the other hand the $u_j$ jump up and down, i.e. $u_j=denom(j/2^m)$, where $denom$ gives the denominator of the reduced fraction $j/2^m$ (for instance, $denom(6/8)=denom(3/4)=4$) then (1) with $p=2^m$ is $m/2$ and so increases for $m\to\infty$. However, in this case, the variation of the $u_j$ also increases for $m\to\infty$.
The overall idea shall be to show that if $x:[0,1]\to\mathbb R$ is a function of bounded variation with $Var(x)\leq r$, then $Var(g(\cdot,x(\cdot)))\leq 4M_r$, but I was not able to wrap my head around it so far.
Any ideas are highly appreciated. Thank you in advance!
 A: I claim that $M_r = 2r+1$ does the trick.
Denote $T=(t_0,\dots,t_p)$, $U=(u_0,\dots,u_p)$, $\|U\|= \sum_{j=1}^p|u_{j-1}-u_j|$ and $G(U) = \sum_{j=0}^p|g(t_j,u_j)|$. We have to prove that $G(U) \le 2\|U\|+1$ for all possible $U$. Here is a visualization (the values in the middle are the non-zero values of $g$):

If we stay in one layer over a period $\Delta t$, then $G(U)$ increases at most by $\Delta t$. Therefore, staying in one layer for the whole time yields $G(U)\le 1$ and $\|U\|=0$.
If we switch into some layer $k$ (over a time period $\Delta t$), we gain (compared to staying in the previous layer) at most $\Delta G = \frac{1}{2^k}$, which is the value of $g$ in the $k$-th layer, while paying the prize of at least $\Delta\|U\| = \frac{1}{2^{k-1}}$, which is the minimal distance from layer $k$ to another layer.
Therefore the ratio is at most $2$, since
$$
\frac{\Delta G }{\Delta\|U\|} \le 2
$$
These considerations imply $G(U) \le 1 + 2\|U\|$ for all possible $U$.
Remark: $M_r = 2r+1$ is probably not a tight bound.
