$\def\ZZ{\mathbb{Z}}$Call a function $f : \ZZ \to \ZZ$ "contracting" if $$|f(j) - f(i)| \leq |j-i|$$ for all $i$, $j \in \ZZ$. The contracting functions form a monoid under composition; call it $C$. An element of a monoid is called a "unit" if it is invertible; the units of $C$ are the functions $x \mapsto \pm x + k$. An element of a monoid is called ``irreducible" if it is not a unit and cannot be factored as the composition of two non-units.
Question 1: What are the irreducibles of $C$?
To give two nonobvious examples, the maps $x \mapsto |x|$ and $x \mapsto \begin{cases} x & x \geq 0 \\ x+1 & x < 0 \end{cases}$ are both irreducible.
The problem which I actually want the answer to is a slight variant of $C$: Define $C_2$ to be the monoid of maps $f : \ZZ \to \ZZ$ which are contracting and obey $f(i) \equiv i \bmod 2$. So what I would really like to know is:
Question 2: What are the irreducibles of $C_2$?
If you prefer finite monoids, I am fine with you working with $\{ 0,1,2,\ldots,n \}$ instead of $\ZZ$ for either question.