Solution:
The only such function is f(p,q)=p⋅q.
This function obviously satisfies the first condition for p=0 or q=0. For pq=0 we have
1+21f(p+1,q−1)+21f(p−1,q+1)=1+21(p+1)(q−1)+21(p−1)(q+1)=pq,
so that the second condition is also satisfied.
It remains to be shown that there is no other function with these properties. To do this, we set f(p,q)=pq+g(p,q). For pq=0 the second condition gives
pq+g(p,q)=1+21((p+1)(q−1)+g(p+1,q−1)+(p−1)(q+1)+g(p−1,q+1)),
that is
g(p,q)=21(g(p+1,q−1)+g(p−1,q+1)).
Hence the numbers g(0,p+q), g(1,p+q−1),g(2,p+q−2),…,g(p+q−1,1),g(p+q,0) form an arithmetic sequence. Since its outer terms g(0,p+q) and g(p+q,0) are equal to zero, every term of the sequence has the value zero. Consequently g(p,q)=0 for all nonnegative integers, and therefore f(p,q)=p⋅q is the only solution.