As far as I remember, many textbooks on statistical physics introduce temperature as a condition of equilibrium of a composite thermodynamic system. E.g., if the system consists of two parts with energies $E_1,E_2$, and the total energy is fixed, $E=E_1+E_2$, then maximizing the entropy (and neglecting the small contributions due to the interactions on the systems borders) we have: $$ \frac{d}{dE_1}\left[S_1(E_1) + S_1(E-E_1)\right]=S_1'(E_1) - S_2'(E-E_1)=0\\\Rightarrow S_1'(E_1) = S_2'(E-E_1)\\\Rightarrow E_1^*, \frac{1}{T}=S_1'(E_1^*)=S_2'(E-E_1^*) $$ The temperature is thus a value of the derivative of the entropy (logarithm of the number of the microstates at thermal equilibrium, but not the derivative itself (the difference between a function and a value of this function at a specific point, contrary to what is suggested in this question, which motivated me to ask mine.)
What I miss here is the transition from this definition of temperature to the condition of thermal equilibrium as the equality of temperatures - this means that the temperature must be defined for each subsystem independently. So, is the temperature a function (of energy) or a value of a function at thermal equilibrium?