I have read this PSE post Finite Temperature Quantum Field Theory, saying that
In a QFT at finite temperature, we consider the Euclidean time to be periodic, i.e. we consider a theory on the manifold $\mathbb{R}^{d−1}×S^1$, where the spatial coordinates are in $\mathbb{R}^{d−1}$ and the time coordinate in $S^1$. The temperature of the system is then the inverse of the circumstance $T=1/\beta,\ \tau\in[0,\beta)$.
Why are we allowed to identify the imaginary time as the inverse of the temperature and why do we enforce periodicity on the circle of circumference $\beta$, i.e. why does the condition $\phi(0,\vec{x})=\pm\phi(\beta,\vec{x})$ (for $\vec{x}$ being a vector in $\mathbb{R}^{d-1}$), where $\phi$ is some scalar field, has to hold?
I have also read another PSE post Why is Euclidean Time Periodic?, saying that
it turns out that thermal averages of operators are periodic with respect to the Wick rotated time $\tau$
Is this motivation enough for us to impose this periodicity in thermal field theories?
I realize that this may be a textbook question, so if it is, please point me to the right direction. If not, please answer this post.