What is the function and how did Kirchoff use the concept of the function to infer that the blackbody radiation distribution depends only on temperature?
See above questions. To recap the argument: a that depends on anything other than temperature will lead to energy flow for some wavelength intervals (at wavelengths for which one body has more intensity than the other), leading to net energy transfer- and this is forbidden for bodies at the same temperature. You can have heat transfer with no if you just have a phase change: ice water plus heat can turn into ice water with less ice, at constant temperature. Yes, but the situation you describe represents a system which is neither isolated nor in equilibrium. The ice water is not isolated and heat transfers in from outside. In Kirchoff’s thought experiment, the bodies are isolated and in equilibrium when they are connected.