2. Find all functions $f: \mathbb{Z} \rightarrow \mathbb{R}$ such that $f(1)=\frac{5}{2}$ and

$$
f(x) f(y)=f(x+y)+f(x-y), \text { for all } x, y \in \mathbb{Z}
$$
Solution. If $x=y=0$ we have $f(0)^{2}=2 f(0)$, and from there $f(0)=0$ or $f(0)=2$. Let $f(0)=0$. If $y=1$ we have $\frac{5}{2} f(x)=f(x+1)+f(x-1)$, that is,

$$
f(x+1)=\frac{5}{2} f(x)-f(x-1)
$$

Then $f(2)=\frac{25}{4}, f(3)=\frac{105}{8}, f(4)=\frac{425}{16}$. But from $f(2)^{2}=f(4)+f(0)$ it follows that $f(4)=\frac{625}{16}$. Therefore, $f(0) \neq 0$.

Let $f(0)=2$. Since $f(x) f(-y)=f(x-y)+f(x+y)=f(x) f(y)$, for all $x, y \in \mathbb{Z}$, then it is also true for $x=1$. But since $f(1) \neq 0$ we get that $f(-y)=f(y)$, for every $y \in \mathbb{Z}$, that is, the function is even. We have $f(0)=2$, $f(1)=\frac{5}{2}, f(2)=\frac{17}{4}, f(3)=\frac{65}{8} \ldots$. Therefore, by induction we will prove that if $x$ is a positive integer then $f(x)=\frac{2^{2 x}+1}{2^{x}}$ is the only solution (unique because each functional value depends only on the previous two values, that is, $f(x+1)=\frac{5}{2} f(x)-f(x-1)$). It is clear that for $x=1$ the statement is true. Let it be true for every $t<x, t \in \mathbb{N}$. Then we have

$$
f(t+1)=\frac{5}{2} f(t)-f(t+1)=\frac{5}{2} \frac{2^{2 t}+1}{2^{t}}-\frac{2^{2(t-1)}+1}{2^{t-1}}=\frac{2^{2(t+1)}+1}{2^{t+1}}
$$

From $f(0)=\frac{2^{2 \cdot 0}+1}{2^{0}}=2$ and from the fact that $f$ is an even function, we get that $f(x)=\frac{2^{2 x}+1}{2^{x}}$ is the only function that satisfies the equation for every integer $x$. The converse is clear, that is, it is easy to verify that if $f(x)=\frac{2^{2 x}+1}{2^{x}}$, then it satisfies the given equation.