You should say in what sense you want to approximate the function - e.g. the sup norm (minimize the maximum difference between the value of the function and the value of the approximation), L2 norm - minimize mean square error, or maybe in some other sense.
In the first case look up the Stone-Weierstrass theorem, in the second case look at Fourier series for functions of many variables. Start from a mathematical analysis textbook, e.g. Walter Rudin: Principles of Mathematical Analysis, or do a search on the subjects I mentioned.