In calculating entropy change of surroundings how do we find the initial state? Suppose we have a system characterized by $S=S(U,V,n)$ and surroundings characterized by $S'=S'(U',V',n')$. To calculate the change in entropy of the system (after a process) we just need to take the difference $ΔS=S_f - S_i$. The same goes with surroundings that is $ΔS'=S'_{f} - S'_{i}$. What I can't understand is what we consider as the initial state of the surroundings. For example, suppose we have a gas inside a container with a movable piston. If the external pressure changes then the system will reach a new equilibrium. Will the initial state of the surroundings be at the moment the pressure change takes place or the moment before the change?
 A: 
What I can't understand is what we consider as the initial state of
the surroundings.

We generally don't care what the actual entropy of the surroundings or system is. We generally only care about the change in entropy of each.
We can determine the change in entropy of the surroundings by determining the change in entropy of the system. If the process is reversible, then $\Delta S_{surr}=-\Delta S_{sys}$ or $\Delta S_{sys}+\Delta S_{surr}=0$. For an irreversible process $\Delta S_{sys}+\Delta S_{surr}>0$ by an amount equal to the entropy generated in the system due to the irreversible process, which can be calculated.

For example, suppose we have a gas inside a container with a movable
piston. If the external pressure changes then the system will reach a
new equilibrium. Will the initial state of the surroundings be at the
moment the pressure change takes place or the moment before the
change?

The initial state of the surroundings will be its entropy the moment before the pressure change (prior to the start of the process). But again, we generally don't care what the actual value of the entropy of the surrounding is, just the change in entropy which can be determined by the change in entropy of the system. For your example we would need more information on the process to determine the change.
Hope this helps.
