How many functions $f: \mathbb{Z} \rightarrow \mathbb{R}$ satisfy the following three properties?

(a) $f(1)=1$;

(b) For all $m, n \in \mathbb{Z}, f(m)^{2}-f(n)^{2}=f(m+n) f(m-n)$;

(c) For all $n \in \mathbb{Z}, f(n)=f(n+2013)$.
By plugging $m=n=0$ into (b) we easily get $f(0)=0$. For any $u \in \mathbb{Z}$, we have

$$
\begin{aligned}
f(u+1)^{2}-f(u-1)^{2} & =f(2 u) f(2) \\
f(u+1)^{2}-f(u)^{2} & =f(2 u+1) f(1)=f(2 u+1) \\
f(u)^{2}-f(u-1)^{2} & =f(2 u-1) f(1)=f(2 u-1)
\end{aligned}
$$

whence

$$
f(2 u) f(2)=f(2 u+1)+f(2 u-1) .
$$

We would like to conclude that

$$
f(n+1)+f(n-1)=f(2) f(n)
$$

for all $n \in \mathbb{Z}$. This is indubitable if $n$ is even; otherwise we may use (c) and the fact that $n+2013$ is even.

For any given value of $t=f(2)$, there is a unique function $f$ satisfying the recursive definition

$$
f(1)=1, \quad f(2)=t, \quad f(n+1)+f(n-1)=t f(n) .
$$

If $t \neq \pm 2$, this solution is given by

$$
f(n)=\frac{\lambda_{1}^{n}-\lambda_{2}^{n}}{\lambda_{1}-\lambda_{2}} \quad \text { where } \lambda_{1,2} \in \mathbb{C} \text { are the roots of } \lambda^{2}-t \lambda+1=0
$$

Those familiar with the theory of linear recurrences will know a heuristic derivation of this formula. For our purposes it suffices to note that this function $f$ does indeed satisfy definition (3) and in fact the condition (b) as well; thus the problem is to find out how many values of $t$ cause condition (c) to hold.

If $t= \pm 2$, the solution (4) is invalid due to the fact that $\lambda_{1}=\lambda_{2}$. In these cases the corresponding functions $f$ satisfying (3) are $f(n)=n$ and $f(n)=(-1)^{n+1} n$, both of which fail condition (c) and hence can be discarded.

From the condition $f(2013)=f(0)=0$, we derive that $\lambda_{1}^{2013}=\lambda_{2}^{2013}=\lambda_{1}^{-2013}$, so $\lambda_{1}^{4026}=1$. We must have $\lambda^{2013}=1$ or $\lambda^{2013}=-1$. If the latter holds, then from $f(2014)=f(1)$ we get

$$
\begin{aligned}
\lambda_{1}^{2014}-\lambda_{2}^{2014} & =\lambda_{1}-\lambda_{2} \\
\lambda_{1} \cdot \lambda_{1}^{2013}-\lambda_{2} \cdot \lambda_{2}^{2013} & =\lambda_{1}-\lambda_{2} \\
-\lambda_{1}+\lambda_{2} & =\lambda_{1}-\lambda_{2} \\
\lambda_{1} & =\lambda_{2},
\end{aligned}
$$

a contradiction. So $\lambda_{1}$, and hence its reciprocal $\lambda_{2}$, are 2013th roots of unity, a condition that is clearly sufficient to imply (c).

The trivial root $\lambda_{1}=\lambda_{2}=1$ must be discarded. The remaining roots come in 1006 conjugate pairs yielding 1006 distinct real values of $t$. We conclude that there are 1006 such functions $f$.