Problem

Source: Romanian NMO 2021 grade 9 P4

Tags: functional equation, algebra



Let $A$ be a finite set of non-negative integers. Determine all functions $f:\mathbb{Z}_{\ge 0} \to A$ such that \[f(|x-y|)=|f(x)-f(y)|\]for each $x,y\in\mathbb Z_{\ge 0}$. Andrei Bâra