TITLE: New twist on a Putnam problem
QUESTION [25 upvotes]: A recent Putnam problem:

Let $f$ be a real-valued function on the plane such that for every square $ABCD$ in the plane, $f(A)+f(B)+f(C)+f(D)=0$. Does it follow that $f$ is identically zero?

The answer is yes. Without loss of generality consider only the origin. We have
$$f(1,1)+f(-1,1)+f(1,-1)+f(-1,-1)\tag{a}$$
$$f(0,0)+f(0,1)+f(1,0)+f(1,1)\tag{b}$$
$$f(0,0)+f(0,1)+f(-1,0)+f(-1,1)\tag{c}$$
$$f(0,0)+f(0,-1)+f(1,0)+f(1,-1)\tag{d}$$
$$f(0,0)+f(0,-1)+f(-1,0)+f(-1,-1)\tag{e}$$
$$f(1,0)+f(-1,0)+f(0,-1)+f(0,1)\tag{f}$$
are all zero. Then $f(0,0)=[\rm(b)+(c)+(d)+(e)-(a)-2(f)]/4=0$. A similar argument works when we replace the condition in the problem with triangles $\triangle ABC$. I have pictured both ideas as so-called "proof without words" below:

What happens when we replace the codomain of $f$ with an abelian group of exponent dividing $4$ or $6$ respectively? Do there then exist non-constant maps with these properties?

REPLY [3 votes]: As noted in several other answers, the purely discrete version of the problem (with ${\mathbb Z}^2$ in place of ${\mathbb R}^2$) has a few solutions, and the possibility of rescaling in $\mathbb R$ forces any solution in this case. Here is some more information on the discrete problem.
By considering first smaller families of squares or triangles, one can avoid the torsion problem and obtain nice characterizations of the solutions. Then, a final small adjustment is needed to obtain a full charcaterization to the solution of the initial problem.
 Theorem  Let $G$ be an arbitrary abelian group, and let $V$ be the module of all maps$f: {\mathbb Z}^2 \to G$ whose sums are zero on all the squares of the form $(x,y)+[0,1]^2$ and $\lbrace (x,y), (x+1,y+1), (x,y+2), (x-1,y+1)\rbrace$. Then the ${\mathbb Z}$-linear map
$$
\phi : V \to G^4,\ \  f \mapsto (f(1,1),f(0,0),f(1,0),f(2,0))
$$
is an isomorphism. Indeed, for $(a,b,c,d)\in G^4$ the unique $f$ such that $\phi(f)=(a,b,c,d)$, is given by the following rule : for integers $x,y,i,j$,
$$
f(x,y)=
\begin{cases}
-ya & -(i+j-1) b&  &+(i-j)d & \text{if }\  x=2i,& y=2j  \\
-ya & +(i-j-1) b& -c& -(i+j)d & \text{if}\ x=2i,& y=2j+1\\
ya & -(i-j)b& c & +(i+j)d & \text{if}\  x=2i+1,& y=2j \\
ya & +(i+j)b& & -(i-j)d & \text{if}\  x=2i+1,& y=2j+1
 \\
\end{cases}\tag{*}
$$
 Corollary  Let $G$ be an arbitrary abelian group, and let $f: {\mathbb Z}^2 \to G$ be a map. Then the sum of $f$ is zero over all the rectangles of ${\mathbb Z}^2$ iff $f$ satisfies (*) above for some four tuple $(a,b,c,d)$ with
$4a=4b=4c=4d=0$ in $G$.
 Proof of the theorem  :