
6. Let $f: \mathbb{Z} \rightarrow \mathbb{Z}$ be a function satisfying $f(0) \neq 0, f(1)=0$ and

(i) $f(x y)+f(x) f(y)=f(x)+f(y)$;

(ii) $(f(x-y)-f(0)) f(x) f(y)=0$,

for all $x, y \in \mathbb{Z}$, simultaneously.

(a) Find the set of all possible values of the function $f$.

(b) If $f(10) \neq 0$ and $f(2)=0$, find the set of all integers $n$ such that $f(n) \neq 0$.


Solution: Setting $y=0$ in the condition (ii), we get

$$
(f(x)-f(0)) f(x)=0
$$

for all $x$ (since $f(0) \neq 0$ ). Thus either $f(x)=0$ or $f(x)=f(0)$, for all $x \in \mathbb{Z}$. Now taking $x=y=0$ in (i), we see that $f(0)+f(0)^{2}=2 f(0)$. This shows
that $f(0)=0$ or $f(0)=1$. Since $f(0) \neq 0$, we must have $f(0)=1$. We conclude that

$$
\text { either } f(x)=0 \text { or } f(x)=1 \text { for each } x \in \mathbb{Z}
$$

This shows that the set of all possible value of $f(x)$ is $\{0,1\}$. This completes (a).

Let $S=\{n \in \mathbb{Z} \mid f(n) \neq 0\}$. Hence we must have $S=\{n \in \mathbb{Z} \mid f(n)=1\}$ by (a). Since $f(1)=0,1$ is not in $S$. And $f(0)=1$ implies that $0 \in S$. Take any $x \in \mathbb{Z}$ and $y \in S$. Using (ii), we get

$$
f(x y)+f(x)=f(x)+1
$$

This shows that $x y \in S$. If $x \in \mathbb{Z}$ and $y \in \mathbb{Z}$ are such that $x y \in S$, then (ii) gives

$$
1+f(x) f(y)=f(x)+f(y)
$$

Thus $(f(x)-1)(f(y)-1)=0$. It follows that $f(x)=1$ or $f(y)=1$; i.e., either $x \in S$ or $y \in S$. We also observe from (ii) that $x \in S$ and $y \in S$ implies that $f(x-y)=1$ so that $x-y \in S$. Thus $S$ has the properties:

(A) $x \in \mathbb{Z}$ and $y \in S$ implies $x y \in S$;

(B) $x, y \in \mathbb{Z}$ and $x y \in S$ implies $x \in S$ or $y \in S$;

(C) $x, y \in S$ implies $x-y \in S$.

Now we know that $f(10) \neq 0$ and $f(2)=0$. Hence $f(10)=1$ and $10 \in S$; and $2 \notin S$. Writing $10=2 \times 5$ and using (B), we conclude that $5 \in S$ and $f(5)=1$. Hence $f(5 k)=1$ for all $k \in \mathbb{Z}$ by (A).

Suppose $f(5 k+l)=1$ for some $l, 1 \leq l \leq 4$. Then $5 k+l \in S$. Choose $u \in \mathbb{Z}$ such that $l u \equiv 1(\bmod 5)$. We have $(5 k+l) u \in S$ by (A). Moreover, $l u=1+5 m$ for some $m \in \mathbb{Z}$ and

$$
(5 k+l) u=5 k u+l u=5 k u+5 m+1=5(k u+m)+1
$$

This shows that $5(k u+m)+1 \in S$. However, we know that $5(k u+m) \in S$. By (C), $1 \in S$ which is a contradiction. We conclude that $5 k+l \notin S$ for any $l, 1 \leq l \leq 4$. Thus

$$
S=\{5 k \mid k \in \mathbb{Z}\}
$$

$\qquad$

