Functional equations and separation of variables for exact g-function