Lipschitz continuity of $f(x)=|x|$ on $[-1,1]$ with period $2.$

Consider $n-m=1$. Since $0 < x-y \leq 1$ and $y < 2m+1 = 2n-1$, it follows that $x = x-y + y < 2n$. Similarly, with $x \geq 2n-1 = 2m+1$ it can be shown that $y = y - x + x \geq 2m$. Therefore $f(x) = |x-2n| = 2n - x$ and $g(y)=|y-2m|=y - 2m$ and hence $|f(x)-f(y)| \leq |x-y|$.

Alternatively, you could consider the fact that $f$ can be represented both as $$ f(x) = |x-2k|, \quad 2k - 1 \leq x < 2k + 1, $$ or as $$ f(x) = 1 - |x-2k + 1|, \quad 2k \leq x < 2k + 2, $$ which are clearly piecewise Lipschitz functions. Then you would note that if $|x-y| \leq 1$, there must exist an integer $p$ such that $p \leq x, y < p + 2$.


Since $$2m - 1 \leq y < 2m + 1 \leq x < 2m+3$$ and, by assumption, $x - y < 1,$ it must be that $2m < y$ and $x <2m+2$. Then it follows that $f(x) = 2m+2 -x$ and $f(y) = y - 2m$, so $$|f(x) - f(y)| = |x + y -4m -2| \leq |x-(2m+1)| + |(2m+1) -y| = |x-y|.$$


Note that $f(x) = \min_{n\in \mathbb{Z}} |x-2n|$. Suppose $n_y$ is such that $f(y) = |y-2n_y|$ (such a $n_y$ always exists).

Then $f(x)-f(y) = \min_{n\in \mathbb{Z}} |x-2n| - |y-2n_y| \le |x-2n_y|- |y-2n_y| \le |x-y|$. Reversing the roles of $x,y$ gives the desired result.