Problem

Source: IMO ShortList 2004, algebra problem 3

Tags: function, number theory, continued fraction, algebra, functional equation, IMO Shortlist



Does there exist a function $s\colon \mathbb{Q} \rightarrow \{-1,1\}$ such that if $x$ and $y$ are distinct rational numbers satisfying ${xy=1}$ or ${x+y\in \{0,1\}}$, then ${s(x)s(y)=-1}$? Justify your answer. Proposed by Dan Brown, Canada