In my analysis course the lecturer constructs the Cantor function iteratively as is done here, then proves that the Cantor function is continuous as follows
\begin{align} \max_{x \in [0, 1]} |f_{n+1}(x) - f_n(x)| & \le \max( \max_{x \in [0, \frac{1}{3})} |f_{n+1}(x) - f_n(x)|,\max_{x \in [\frac{1}{3}, \frac{2}{3}]} |f_{n+1}(x) - f_n(x)|,\max_{x \in (\frac{2}{3}, 1]} |f_{n+1}(x) - f_n(x)|) \\ &= \max( \max_{x \in [0, \frac{1}{3})} |f_{n+1}(x) - f_n(x)|,\max_{x \in (\frac{2}{3}, 1]} |f_{n+1}(x) - f_n(x)|) \\ &= \max( \max_{x \in [0, \frac{1}{3})} |\tfrac{1}{2}f_n(3x) - \tfrac{1}{2}f_{n-1}(3x)|,\max_{x \in (\frac{2}{3}, 1]} |\tfrac{1}{2}f_n(3x-2) - \tfrac{1}{2}f_{n-1}(3x-2)|) \\ &=\frac{1}{2} \max_{x \in [0,1]}|f_n(x) - f_{n-1}(x)|\\ &\le \left(\frac{1}{2} \right)^{n-1} \max_{x \in [0,1]}|f_2(x) - f_1(x)|\\ &=\left(\frac{1}{2} \right)^n \end{align}
Where we obtain the second inequality by applying the first n-1 times. He then shows that $(f_n)_{n\ge1}$ is uniformly Cauchy and hence uniformly convergent to the Cantor function, and since each $f_n$ is continuous so is $f$. But, surely equality always holds in the first step, since if $y \in [0,1]$ is such that
$$\max_{x \in [0, 1]} |f_{n+1}(x) - f_n(x)| = |f_{n+1}(y)-f_n(y)|$$
then $y$ will be contained in one of the subintervals $[0, \frac{1}{3}),[\frac{1}{3}, \frac{2}{3}],(\frac{2}{3}, 1]$, and so
$$\max( \max_{x \in [0, \frac{1}{3})} |f_{n+1}(x) - f_n(x)|,\max_{x \in [\frac{1}{3}, \frac{2}{3}]} |f_{n+1}(x) - f_n(x)|,\max_{x \in (\frac{2}{3}, 1]} |f_{n+1}(x) - f_n(x)|)$$
will be equal to $|f_{n+1}(y)-f_n(y)|$? Has the lecturer made a mistake? If not can someone give me a reason or proof that equality doesn't always hold?