After someone dies they become stiff, this is termed Rigor Mortis and happens because the cells run out of ATP (I think). But why do the cells need it to remain flexible?
You are right that ATP is needed in relation to Rigor Mortis: This for ion pumps to maintain concentration gradients in cells. Without a constant supply of ATP to the pumps, calcium starts to diffuse from the extracellular matrix (and other intracellular compartments with high concerntations of calcium) into the sarcomere where it binds to troponin, a regulatory protein in skeletal muscles. This holds myosin the actin filaments together creating the effect of rigor mortis.