{ "problem": "Find all functions$f:\\mathbb{Z}\\rightarrow\\mathbb{Z}$\n such that the equation\n \\[\n f(x-f(xy))=f(x)f(1-y)\n \\]\n holds for all $x,y\\in\\mathbb{Z}$.", "solution": "Let $P(x,y)$ be the assertion $f(x-f(xy))=f(x)f(1-y)$.\n\n If $f$ is constant, $f\\equiv0$ or $f\\equiv1$. From now on we will\n only consider non-constant functions.\n\n Claim 1 $f(f(x))=f(x)$ for all $x\\in\\mathbb{Z}$\n\n Proof. $P(0,y):f(-f(0))=f(0)f(1-y)\\Longrightarrow f(0)=0$\n\n $P(x,0):f(x)=f(x)f(1)\\Longrightarrow f(1)=1$\n\n $P(1,y):f(1-f(y))=f(1-y)$\n\n $P(1,1-y):f(1-f(1-y))=f(y)$\n\n $P(1,1-f(y)):f(y)=f(1-f(1-y))=f(1-f(1-f(y)))=f(f(y))\\Longrightarrow f(f(x))=f(x)\\forall x\\in\\mathbb{Z}\\blacksquare$\n\n $\\Longrightarrow P(x,1):f(x-f(x))=0$\n\n Now consider $f(\\mathbb{Z})$.\n\n Case 1 $f(\\mathbb{Z})\\subset\\{-1,0,1\\}$\n\n Case 1.1. $f(\\mathbb{Z})=\\{0,1\\}$\n\n We have $f(x)=1\\textbackslash \\Longrightarrow f(x-1)=0\\textbackslash \\Longrightarrow\n f(2-x)=1 \\textbackslash \\Longrightarrow f(1-x)=0$ and $f(1-x)=0\n \\textbackslash \\Longrightarrow f(x)=1$\n\n \\[\n \\therefore f(x)=1\\Longleftrightarrow f(x-1)=0\\Longleftrightarrow f(2-x)=1\\Longleftrightarrow f(1-x)=0\n \\]\n We can inductively prove that $f(x)=\\begin{cases}\n 0 & 2|x\n\n 1 & 2\\nmid x\n \\end{cases}$\n\n Case 1.2. $f(\\mathbb{Z})=\\{-1,0,1\\}\\Longrightarrow f(-1)=-1$\n\n $P(1,x)$ and $P(-1,x)$ gives\n\n \\begin{align*}\n f(x)=1 & \\Longrightarrow f(1-x)=0,f(x+1)=-f(-2)\n\n f(x)=0 & \\Longrightarrow f(1-x)=1,f(x+1)=1\n\n f(x)=-1 & \\Longrightarrow f(1-x)=f(2),f(x+1)=0\n \\end{align*}\n It's easy to see that $f(-2)=1,f(2)=-1$, and using this, we can inductively\n prove that $f(x)=\\begin{cases}\n 0 & 3|x\n\n 1 & 3|x-1\n\n -1 & 3|x+1\n \\end{cases}$\n\n Case 2. $f(\\mathbb{Z})$ is not a subset of $\\{-1,0,1\\}$\n\n Case 2.1 $f(t)=1$ for some $2\\mid t$\n\n \\[\n P(2,\\frac{t}{2}):1=f(1)=f(2)f(1-\\frac{t}{2})\n \\]\n\n Case 2.1.1 : $f(2)=1\\Longrightarrow P(2,1):1=f(2)f(0)=0$. Contradiction!\n\n Case 2.1.2 : $f(2)=-1\\Longrightarrow f(-1)=-1,f(1-\\frac{t}{2})=-1$\n\n $P(-1,-x):f(-1-f(x))=-f(1+x)$\n\n $P(-1,-f(x)):f(-1-f(x))=f(-1-f(f(x)))=-f(1+f(x))\\Longrightarrow f(1+x)=f(1+f(x))...(*)$\n\n Since $f(2)=-1$, so plugging this in $(*)$, we have\n\n \\[\n f(2)=-1\\Longrightarrow f(3)=0\\Longrightarrow f(4)=1\\Longrightarrow f(5)=-1\\cdots\n \\]\n We can prove inductively that$f(x)=\\begin{cases}\n 0 & 3|x\n\n 1 & 3|x-1\n\n -1 & 3|x+1\n \\end{cases}$ for all $x\\in\\mathbb{N}$.\n\n Plugging in $x=-1,y=-n(n\\in\\mathbb{N})$ gives $f(-1-n)=f(-1-f(n))=-f(1+n)$,\n so we have $f(x)=\\begin{cases}\n 0 & 3|x\n\n 1 & 3|x-1\n\n -1 & 3|x+1\n \\end{cases}$for all $x$, so contradiction since $f(\\mathbb{Z})\\in\\{-1,0,1\\}$.\n\n Case 2.2 $f(t)=1\\Longrightarrow2\\nmid t$\n\n Claim 2 $f(-1)=-1$ or $f(2)=0$\n\n Proof. Assume that $f(2)\\neq0$\n\n We will prove that $f(t)=1\\Longrightarrow f(1-t)=0$. $P(2,\\frac{1-t}{2})$\n gives\n\n \\[\n f(2)=f(2)f(\\frac{t-3}{2})\\Longrightarrow f(\\frac{t-3}{2})=1\n \\]\n We repeat this, then we get $t\\equiv1(mod2^{n})$ for all $n\\Longrightarrow t=1$.\n Note that\n\n \\[\n f(-1)=c\\Longrightarrow f(-1-c)=0\\Longrightarrow f(c+2)=1\n \\]\n Hence we conclude that $c=-1$.\n\n Case 2.2.1. $f(2)=0\\Longrightarrow f(-1)=1$\n\n Define $n$ as the element of $f(\\mathbb{Z})-\\{-1,0,1\\}$ which has\n the smallest absolute value. Then we have\n\n \\[\n f(x-f(xy))=n\\Longrightarrow\\{f(x),f(1-y)\\}=\\{1,n\\}\\text{ or }\\{f(x),f(1-y)\\}=\\{-1,-n\\}...(\\star)\n \\]\n . Also note that $P(-n,- 1):f(-n-f(n))=0$, where $f(n)=n$ by Claim 1. Thus by $x=n,y=-2$ $(\\star)\\Longrightarrow f(3)=1$.\n Case 2.2.1. now becomes a repetition of Case 1.1, so contradiction!\n\n Case 2.2.2. $f(2)\\neq0,f(-1)=-1,f(-2)=-f(2)$\n\n Claim 3 $f(n)=t\\Longrightarrow n=t\\forall t\\leq1$\n\n Proof. We use induction on $t$. $t=1$ is already proven above. Assume\n that $t$ works.\n\n If $f(n)=t-1\\Longrightarrow f(1+n)=f(1+f(n))=f(t)\\Longrightarrow n=t-1$,\n so we're done.\n\n Use the same method to prove that $f(n)=n\\forall n\\leq1$, and $P(-1,n)(n>0)$\n gives $f(n+1)=-f(-n-1)=n+1$, so $f(n)=n$ for all $n\\in\\mathbb{Z}$.", "grading_guidelines": "(Partial)\n 1. Proved $f(f(x))=f(x)$.\n 2. Handled the case where $f\\subseteq \\{-1, 0, 1\\}$.\n 3. Handled the case where $f\\not \\subset \\{-1, 0, 1\\}$.\n(Almost)\n 1. Verification contains minor mistakes only.", "problem_id": "PB-Advanced-006", "level": "advanced", "category": "Algebra", "source": "Novel Problem", "max_score": 7, "difficulty": "IMO-hard", "short_answer": "$f_{1}(x)\\equiv0$, $f_{2}(x)\\equiv1$,\n$f_{3}(x)\\equiv x$, $f_{4}(x)=\\begin{cases}\n0, & x=2n\\\\\n1, & x=2n+1\n\\end{cases}$, where $n\\in\\mathbb{Z}$, $f_{5}(x)=\\begin{cases}\n0, & x=3n\\\\\n1, & x=3n+1\\\\\n-1, & x=3n+2\n\\end{cases}$, where $n\\in\\mathbb{Z}$" }