Check that two function $f(x,y)$ and $g(x,y)$ are identical Given that $f(x)$ and $g(x)$ are two polynomials of degree $n$, we know that if we can find $n+1$ distinct numbers $x_i$, $i=1,\cdots,n+1$ such that $f(x_i)=g(x_i)$ then $f(x)$ and $g(x)$ are identical.

However I don't know how to do this with two variable functions. How can I check if a function $f(x,y)$ has the form $g(x,y) = Ax^2+Bxy+Cy^2+Dx+Ey+F$ or not? How many pairs $(x_i,y_i)$ do I have to check to make sure that $f(x,y)$ is identical to $g(x,y)$?

Regards.
If $f$ and $g$ are two polynomials of degree $n$, and there are distinct points $x_1, \dots, x_{n+1}$ such that $f(x_i) = g(x_i)$ for $i = 1, \dots, n+1$, then $f = g$. One way to see this is that a generic degree $n$ polynomial has the form 

$$a_nx^n + a_{n-1}x^{n-1} + \dots + a_1x + a_0$$

which contains $n+1$ coefficients. Given $n+1$ points $(x_i, y_i)$ which satisfy the polynomial equation, we obtain $n+1$ equations in $n+1$ unknowns which uniquely determine the coefficients, and hence the polynomial.

If now $f$ and $g$ are polynomials in two variables of degree $n$. A generic such polynomial has the form

$$\sum_{i=0}^n\sum_{j=0}^ia_{ij}x^jy^{i-j}$$

which contains $N:=\frac{(n+1)(n+2)}{2}$ coefficients. Given the situation for one variable polynomials, you may guess that if there are distinct points $(x_1, y_1), \dots, (x_N, y_N)$ with $f(x_i, y_i) = g(x_i, y_i)$ for $i = 1, \dots, N$, then $f = g$. Your guess would be wrong. While it is true that $N$ points of agreement is enough to show that $f = g$, it is not true that any $N$ points will do. Each point will still give an equation so that you obtain $N$ equations in $N$ unknowns, you might get some redundancy which means the system will not have a unique solution.
Here is the basic idea.

Same idea for polynomial in two variables. See how many coefficients they have. This is just a matter of counting. Let us say this number is $N$. Then if the polynomials match at $N$ distinct points which meet some requirements (to be explored below), then they have to be equal.

If the degree is 1, then N=3.
If degree is 2 then N=6
and so on.

Note, if you take the view of the coefficients, then the value of the polynomial at some point gives a linear equation in the coefficients. So if the $N$ points are chosen so that these are linearly independent equations, then if two polynomials match at these points, then they are equal.

I have found that choosing the grid points, so that no more than 2 are in a straight line works (I don't have a proof for this).

** Based on comment from  Michael Albanese**

I want to emphasize, that I do not have a proof and I hope someone would improve my answer. This is just the basic idea.