Let $k$ be an infinite field and $f(X,Y) \in k[X,Y]$ be a polynomial with two variables. If $f(X,Y)$ vanishes on all points $(x,y) \in k^2$, i.e., $$f(x,y) = 0, \forall (x,y) \in k^2$$ can we conclude that $f(X,Y) = 0$?
Put another way, let $k$ be an infinite field, and let $$k[X,Y]^* := \{f : k^2 \longrightarrow k, (x,y) \mapsto f(x,y) \mid f(X,Y) \in k[X,Y]\}$$ denote the ring of polynomial functions. Then do we have $k[X,Y] \cong k[X,Y]^*$?