The function can take input over x = 0,1,2,..2^n-1 for any integer n.
The key is that you are promised that the function is either constant, or it is balanced. "Constant" means that either f(x)=1 or f(x)=0 for every input x, "balanced" means that f(x)=1 for exactly half of the possible inputs...