solvability of an elementary functional equation Is there some other way to characterize the functions $f:\mathbb Z\times \mathbb Z\to \mathbb Z$  which are expressible as
$$f(x,y)=g(x)+g(y)-g(x+y)$$
for some $g:\mathbb Z\to\mathbb Z$?
Easy facts: (1) $f$ must satisfy $f(x,y)=f(y,x)$ and $f(x,0)=g(0)$ for all $x$. (2) Not all functions $f$ are expressible, since for $x,y\in\{1,\ldots,n\}$ the number of choices of $f(x,y)$ the left grows quadratically in $n$ and the number of possible values of $g$ on which they depend, grows just linearly.
 A: This is secretly a question about group cohomology.  Suppose we want to compute $\operatorname{Ext}^*_{\mathbb{Z}G}(\mathbb{Z}, \mathbb{Z})$ when $G=\langle g \rangle$ is infinite cyclic and the action on the integers is trivial.  We can easily write down a free resolution
$$ 0 \to \mathbb{Z}G(g-1) \to \mathbb{Z}G \to \mathbb{Z} \to 0 $$
and work it out from there: in particular it's clear that $\operatorname{Ext}^n$ vanishes for $n>1$.  But we could also try using the bar resolution.  On writing this down and applying $\hom_{\mathbb{Z}G} ( -, \mathbb{Z})$ you find that the ext groups are given by the cohomology of the following cocomplex:
$$ \hom_{\mathbb{Z}G} (\mathbb{Z}G, \mathbb{Z}) \to \hom_{\mathbb{Z}G} (\bigoplus_{g \in G} \mathbb{Z}G[g], \mathbb{Z}) \to \hom_{\mathbb{Z}G} (\bigoplus_{g,h \in G} \mathbb{Z}G[g|h],\mathbb{Z}) \to \ldots $$
Of course, $\hom_{\mathbb{Z}G} (\bigoplus_{g \in G} \mathbb{Z}G[g], \mathbb{Z})$ can be identified with the set of maps of sets $G \to \mathbb{Z}$ and so on.  On doing this we get that $\operatorname{Ext}^2$ is the kernel of the map 
$$\partial_2 : \operatorname{Map}(G\times G, \mathbb{Z}) \to \operatorname{Map}(G\times G\times G, \mathbb{Z}) $$
given by  $\partial_2 (f)(g,h,k)  = f(h,k) - f(gh,k) + f(g,hk) -f(g,h)$, modulo the image of the map $\partial_1: \operatorname{Map}(G , \mathbb{Z}) \to \operatorname{Map}(G\times G, \mathbb{Z})$ defined by $\partial_1(f)(g,h) = f(h) - f(gh) + f(h)$.
We already know that this cohomology group is zero.  But this says exactly that the set of functions $f:G \times G \to \mathbb{Z}$ expressible as $g(x)-g(xy)+g(y)$ is equal to those functions in the kernel of $\partial_2$.
This is equivalent to Denis Serre's answer above - it may look as if there's a discrepancy, but this is fixable by noting that any such f is symmetric.
A: The necessary and sufficient condition is that 
$$f(x,y+z)+f(y,z)=f(y,x+z)+f(x,z),\qquad\forall x,y,z\in\mathbb Z.\qquad (1)$$
On the one hand, this is obviously necessary. On the other hand, the function $g$, if it exists, is given by
$$g(k)=kg(1)-\sum_{j=1}^{k-1}f(j,1).$$
Then $g$ is suitable if and only if
$$f(k,\ell)=\sum_{j=1}^{k-1}f(j,1)-\sum_{j=\ell}^{k+\ell-1}f(j,1),\qquad k,\ell\in\mathbb Z.$$
There remains to check that these relations are consequences of (1).
Note that (1) contains the fact that $x\mapsto f(x,0)$ is constant.
