4. Given functions $f(x)$ and $g(x)$ are defined on $R$, and $f(x-y)=f(x) g(y)-g(x) f(y)$. If $f(1)=f(2) \neq$ 0, then $g(1)+g(-1)=$ $\qquad$ .
4. 1 .

For $x \in R$, let $x=u-v$, then we have
$$
\begin{array}{l}
f(-x)=f(v-u) \\
=f(v) g(u)-g(v) f(u) \\
=-[f(u) g(v)-g(u) f(v)] \\
=-f(u-v)=-f(x) .
\end{array}
$$

Therefore, $f(x)$ is an odd function, and we have
$$
\begin{array}{l}
f(2)=f[1-(-1)] \\
=f(1) g(-1)-g(1) f(-1) \\
=f(1) g(-1)+g(1) f(1) .
\end{array}
$$

But $f(1)=f(2) \neq 0$, so $g(1)+g(-1)=1$.