To be found are integer one-valued functions $f(n_1,n_2)$ with following properties:
- $f(n_1,n_2)=f(n_2,n_1)$,
- $f(f(n_1,n_2),n_3)=f(n_1,f(n_2,n_3))$,
- $f(n_1+n_2,n_1+n_3)=n_1+f(n_2,n_3)$.
So far I have found only the functions $\min(n_1,n_2)$ and $\max(n_1,n_2)$ and wonder, if there are some less trivial functions which would in some cases deliver other values than $n_1$ or $n_2$. If such functions do not exist, a corresponding proof would be desirable.
UPDATE:
As was pointed out by J.-E. Pin the question can be reduced to search of the one-variable (!) function $g(n)$ with the properties:
$\quad$ 1'. $g(n)-g(-n)=n$,
$\quad$ 2'. $g(g(n)-m)+m=g(g(m)-n)+n$.
Using the first property the second one can be also written as:
$\quad$ 2''. $g(n)+g(m-g(n))=g(m)+g(n-g(m))$.
The previously found functions correspond to $g(n)=\min(n,0)$ and $g(n)=\max(n,0)$.
We can at least say that $f$ cannot be analytic. If it were, it could be written as $$f(x,y) = a_{00} + a_{01}x + a_{10}y + a_{11}xy + a_{02}x^2 + a_{20}y^2 + \cdots.$$
Now, by (3), all coefficients must be zero, except for $a_{00}$, $a_{01}$, and $a_{10}$, with the condition that $a_{01} + a_{10} = 1$. Furthermore, by commutativity (1), $a_{01} = a_{10}$, hence $f(x,y) = a_{00} + \frac{1}{2}\left(x+y\right)$. But this latter function does not satisfy associativity (2), so $f$ cannot be analytic.