Space-time tradeoff and the best algorithm
The prototypical f and g here would probably be poly-time and polylog space.  The interesting problem here is connectivity (in directed graphs) which can be solved in polynomial time (using linear space) or in polylog space (using super-polynomial time).  It is a famous open problem whether it can be solved in TIME-SPACE(poly,polylog), a class known as SC.

I.e. your question is a well-known open problem.  I don't think that anything non-trivial is known here.