Equality of polynomial functions modulo n Fix positive integers $m$ and $n$. For all polynomial functions $f,g: \mathbb{Z}^m \to \mathbb{Z}$ define the equivalence relation $\sim$ by
$$f \sim g \iff \forall x \in \mathbb{Z}^m \ ( \ f(x) \equiv g(x) \pmod{n} \ )$$
$\sim$ is compatible with pointwise addition and multiplication of polynomial functions. I have several questions regarding the $\sim$ relation that I'm having trouble finding the answers to. 
Question 1: Given polynomial functions $f,g : \mathbb{Z}^m \to \mathbb{Z}$, let $F,G \in \mathbb{Z}[x_1,\dots,x_m]$ be corresponding polynomials. That is, $F$ is the polynomial corresponding to $f$ and $G$ the polynomial corresponding to $g$. Is this statement true or false?
$$f \sim g \iff F \equiv G \pmod{\langle \{n,x_1^{\phi(n)+1}-x_1,\dots,x_m^{\phi(n)+1}-x_m\} \rangle}$$
where $\phi$ is Euler's totient function and for a subset $A$ of a ring $R$, $\langle A \rangle$ denotes the ideal generated by $A$, and $x \equiv y \pmod{\langle A \rangle}$ iff $x-y \in \langle A \rangle$.
If the statement is false, is it true if $n$ is prime?
Question 2: Given polynomial functions $f,g : \mathbb{Z}^m \to \mathbb{Z}$, is there an algorithm to determine whether or not $f \sim g$, without calculating $f(a)-g(a) \pmod{n}$ for every $a \in \{0,\dots,n-1\}^m$ (or any other complete residue system modulo $n$)?
Question 3: Does the type of equivalence given by $\sim$ have a typical name? It's not polynomial congruence mod $n$. Is there a textbook or other reference that deals specifically with relations similar to $\sim$?
Any help or information is very much appreciated. Thank you for your time and consideration.
 A: Question 1 is of course the same as asking whether
$f \sim 0 \Longleftrightarrow F \in \langle n,x_i^{\phi(n)+1}-x_i, 1 \leq i \leq m \rangle$
holds.
For composite $n$, this is even false in one variable. Consider $n=15$ and $f=(x^3-x)(x^5-x)$. Clearly $f(a)=0 \mod 15$ for any integer $a$, but
$$(x^3-x)(x^5-x)=x^8-x^6-x^4+x^2 \notin (15,x^{9}-x).$$
Too see that, note that multiplication with $x^9-x$ satisfies the usual addition of degrees even in $\mathbb Z/15\mathbb Z[X]$, since it is a monic polynomial. In particular a polynomial of degree $8$ cannot be contained in $(x^9-x) \in \mathbb Z/15\mathbb Z[X]$.

For a prime number $p$ however, the statement turns out to be true.
Note that we have to show the following: Let $F \in \mathbb F_p[x_1, \dotsc, x_n]$. Then $F$ vanishes everywhere if and only if $F \in \langle x_i^p-x_i, 1 \leq i \leq m \rangle$. This is the same as saying:
$$\mathcal I(\mathbb A^n_{\mathbb F_p}) = \langle x_i^p-x_i, 1 \leq i \leq m \rangle$$
To show that, we use the following fact from algebraic geometry: $\mathcal I(X \times Y) = \mathcal I(X) + \mathcal I(Y)$ if the field is perfect, see here.
This shows, that you only have to treat the case $m=1$ and this is an easy one and left to you:

Let $F \in \mathbb F_p[X]$. If every element of $\mathbb F_p$ is a root of $F$,
  then $F$ is divisible by $X^p-X$.


To question 2:
The positive answer to question 1 yields the following algorithm for prime numbers:
The generators of $\langle x_i^p-x_i, 1 \leq i \leq m \rangle$ already form a Groebner basis of this ideal, i.e. we can test $F$ to be in that ideal by the multivariate polynomial division algorithm. For large primes $p$ that should be faster than the trivial 'test all $p^m$ residues'-thingie.
