In stack-based storage allocation scheme for activation records, a function generally returns a value or an address (pointer). When a function (say the name is B) is to be returned by a function (say the name is A), the function B would have been defined within this function A itself.
When you return the function B you must be returning the address of the function B (will depend on the implementation of the language which is not our priority here), which resides in the activation record of A. As soon as A finishes, it will return the address of B and code of A will get popped out of stack. Now the function returned (B) is now referring to a something which is no more available as A has already been popped and with it, the code for B has also been removed. So, there is no way in which it could be implemented in this way. Hope you understood.
Please refer https://gateoverflow.in/477/gate2008-54 for detailed discussion.