For a given positive integer $n$, let $A_n$ be the set of all points $(x,y)$ in the coordinate plane with $x,y \in \{0,1,...,n\}$. A point $(i, j)$ is called internal if $0 < i, j < n$. A real function $f$ , defined on $A_n$, is called good if it has the following property: For every internal point $x$, the value of $f(x)$ is the arithmetic mean of its values on the four neighboring points (i.e. the points at the distance $1$ from $x$). Prove that if $f$ and $g$ are good functions that coincide at the non-internal points of $A_n$, then $f \equiv g$.
Problem
Source: Israel Grosman Memorial Mathematical Olympiad 1995 p7
Tags: algebra, function, lattice