Stress energy tensor components for a perfect fluid The stress energy tensor for a perfect fluid is given by $$T_{\mu\nu}=(\rho+p)U_{\mu}U_{\nu}-pg_{\mu\nu}$$ where U is the 4-velocity. The matrix components of the SEM are written as $$T_{\mu\nu}=diag(\rho,p,p,p).$$  Will this always be the components of the stress energy tensor despite having different components for the metric in each case or do they change according to the formula?
 A: Take your stress-energy tensor
$$
T_{\mu\nu}=(\rho+p)U_{\mu}U_{\nu}-p g_{\mu\nu}
$$
This is a legit tensor written in terms of other tensors (the scalar fields $\rho$ and $p$, the metric and the velocity field). Note that  $\rho$ and $p$ are scalars by construction, because are physical properties of the matter in the local reference frame comoving with the local matter element.
For example, If you want the energy in the local comoving reference frame, you just have to calculate $T_{\mu\nu} U^\mu U^\nu$.
This representation of $T_{\mu\nu}$ is tensorial, meaning that it's always valid (for any spacetime and fluid configuration). The second representation that you're proposing is valid only in the reference frame of the fluid (aka, a frame that is instantaneously comoving with a local fluid element). Locally, in this frame, the velocity is represented by $U^\mu \sim (1,0,0,0)$. Therefore, $T^{00}= \rho$, and so on... (you find the diagonal matrix representation). Again, this is valid for every metric, but in a specific "tetrad" of the fluid element.
See also: https://en.wikipedia.org/wiki/Perfect_fluid#:~:text=Perfect%20fluids%20are%20used%20in,the%20evolution%20of%20the%20universe.
