We define the concept of a polynomial function from Z n to Z m , which is a generalization of the well-known polynomial function from Z n to Z m . We obtain a necessary and sufficient condition on n and m for all functions from Z n to Z m to be polynomial functions. Then we present canonical representations and the counting formula for the polynomial functions from Z n to Z m . Further, we give an answer to the following problem: How to determine whether a given function from Z n to Z m is a polynomial function, and how to obtain a polynomial to represent a polynomial function?