Without more information about f and g, this problem is NP-hard to solve. The topic is quite broad, check the family of Branch and Bound algorithms, depending of additional information you can do better than NP-hard, in particular, it makes use of monotonicity to guide its search.
Worth to mention too are Genetic algorithms and Simulated Annealing, which, in general, gives you a good enough solution.