I apologize "basics foundations of thermodynamics" still does not make a lot of sense to me.
Steve B already provided some answer associated to one way to interprete the word "foundation" that is from statistical mechanics. I will kinda play here devil's advocate and assume that you are refering to axiomatic thermodynamics.
As far as I am concerned, the foundations of axiomatic thermodynamics are simply experimental facts but there are many ways to choose the set of fundamental axioms to derive all the other results of thermodynamics and this may be related then to the question you ask.
The second principle of thermodynamics tells you that there is a quantity called entropy and labeled $S$ that is a function that depends on the state of the system only. Now, it also says that for an isolated system under a spontaneous evolution towards thermodynamic equilibrium, the entropy can only increase.
Let us consider for a minute the case of an isolated system that comprises of two identical sub-systems 1 and 2 but that have different internal energies $U_1^0$ and $U_2^0$ such that, say, $U_1^0 > U_2^0$.
Once these sub-systems are put in thermal contact, the whole system is out of equilibrium and there should be a heat flux from sub-system 1 to sub-system 2.
Let us describe it more formally:
The total entropy of the system at any moment (if we imagine the heat transfer slow enough) is given by:
$S_{tot}(t) = S_1(t)+S_2(t) = S(U_1^t,V,N)+S(U_2^t,V,N)$
Note that I used the same function $S$ for both systems since I have said previously that they were the same. However, they are not in the same state and therefore their entropies are different.
Let us assume that over a time interval $\delta t$, $U_1^t \rightarrow U_1^t + \delta U_1$ and $U_1^t \rightarrow U_2^t + \delta U_2$ then, the entropy of the total has to change by an amount:
$\delta S_{tot}(t) = S_{tot}(t+\delta t) - S_{tot}(t) = \left(\frac{\partial S}{\partial U_1}\right)_{V,N}\delta U_1 + \left(\frac{\partial S}{\partial U_2}\right)_{V,N}\delta U_2$
Note also that because of its extensive property $\delta S_{tot} = \delta S_1 + \delta S_2$
By identification (this step may not be very rigorous) we then have that:
$\delta S_i = \left(\frac{\partial S}{\partial U_i}\right)_{V,N}\delta U_i$
Since the sub-systems are only in thermal contact, there is not work exchanged between them and the first principle of thermodynamic says then that $\delta U_i = \delta Q_i$ we thus have:
$\delta S_i = \left(\frac{\partial S}{\partial U_i}\right)_{V,N}\delta Q_i$
Finally, to evaluate what is $\left(\frac{\partial S}{\partial U_i}\right)_{V,N}$, you can look at two cases:
At time $t$ the system is at equilibrium and therefore $\delta S_{tot}=0$ implies that $\left(\frac{\partial S}{\partial U_1}\right)_{V,N}=\left(\frac{\partial S}{\partial U_2}\right)_{V,N}$, it thus corresponds to an intensive variable that has to "thermalize" between systems at thermal equilibrium...it has to be related to the temperature
At time $t$ the system is still out of equilibrium and $\delta S_{tot} > 0$ implies that $\left(\frac{\partial S}{\partial U_1}\right)_{V,N} < \left(\frac{\partial S}{\partial U_2}\right)_{V,N}$
Since the subsystems are the same it implies that the higher the temperature of a system the smaller the intensive variable, the simplest quantity that does the job is $1/T$
This derivation does not exclude more complicated - always decreasing - functions of $T$ and I do not know if they should be completely excluded at this stage anyway...I guess that it can be made pretty sure that it should be $1/T$ then by using Schwartz theorem of equality of cross partial derivatives byt changing then the volume or the number of particles, but I am too lazy for that now, sorry.