Why is it possible to calculate the equilibrium potential of an ion using the Nernst equation from empirical measurements in the cell at rest?
Excellent question! The answer is actually a really cool and crucially important detail about membrane potentials and the movement of ions. Basically, the electric force is very strong. You don't actually need to move many ions for the membrane potential to fluctuate dramatically. The number of ions that "move" to establish equilibrium is tiny compared to the actual concentrations. That's why the Nernst and GHK equations are so powerful: what really matters is the relative permeability of different ions and the gross concentration differences, not the changes in their concentration that occur when, for example, voltage-gated channels open during an action potential.

You can calculate just how many ions have to move, which depends on the size of the cell. Here is a nice example from the reference I have linked below:


  For a typical cell, 1 microcoulomb of charge (6 × 10^12 monovalent ions) per square centimeter of membrane, transferred from one side of the membrane to the other, changes the membrane potential by roughly 1 V. This means, for example, that in a spherical cell of diameter 10 μm, the number of K+ ions that have to flow out to alter the membrane potential by 100 mV is only about 1/100,000 of the total number of K+ ions in the cytosol.


Therefore to answer your question: why is it allowed to use the resting concentrations? Because the concentrations of the ions don't change by more than 1/100,000 fold with a 100mV swing in potential, and there isn't much impact on the GHK/Nernst equation from a change this small. For example, as the voltage goes from ~-70mV when a fairly typical neuron is at rest (and the membrane is most permeable to K+), up to maybe +30mV at the peak of an action potential (and the membrane is most permeable to Na+), only a "few" sodium ions actually cross the membrane, so maybe the internal sodium concentration changes from 10mM to 10.0001mM. The thing that changes most during an action potential is not the actual concentrations, only the permeability to different ions.

Maybe an additional misconception you have is about the cell "deciding" what the concentrations are. Indeed, if the concentrations of particular ions changed dramatically, it would be necessary to recompute equilibrium potentials. The key concept is that those concentrations don't change much during normal functioning of the cell, and they don't have to change much to observe big changes in membrane potential. An excitable cell uses those swings in membrane potential as the signal, rather than the concentrations of the ions. One exception is calcium, see the note at the end.

Reference:

Alberts, B., Johnson, A., Lewis, J., Raff, M., Roberts, K., &amp; Walter, P. (2002). Ion channels and the electrical properties of membranes.

(as a side note, movement of ions does matter over a longer time scale, which is why it is necessary for the Na+/K+ pump to constantly operate to keep the membrane potential steady, and some ions like Ca2+ are at such low concentrations normally that the influx of calcium can be substantial relative to the resting concentration, which is partly why calcium is so powerful as a second messenger and why calcium chelating components of the cell are important)