Suppose I have a compound with 2 chiral centres which are at (S,S). Now, suppose I have an iodine atom attached to the back carbon, and I wish to carry out an $\mathrm{S_N2}$ type substitution in a non-polar solvent. Obviously, the iodine atom would get replaced by the nucleophile, and there should be an inversion of configuration. But is this inversion only for the back carbon or the compound as a whole? Should the product have a configuration (R,S) or (R,R)? Someone please explain this to me briefly.
Here I have a compound with 2 chiral centers. There is only inversion at Carbon with iodine undergoing $\mathrm{S_N2}$ reaction. The second carbon does not undergo $\mathrm{S_N}$ reaction. There is no change in its configuration.
Example 1
In the example below ,
[Ref : https://en.chem-station.com/reactions-2/2016/05/neighboring-group-participation.html]
before a nucleophile attacks externally, OH of carboxylic group attacks internally via $\mathrm{S_N2}$. The 3 membred ring opens via another $\mathrm{S_N2}$ attack by hydroxide ion. The net result is retention of configuration .
Example 2
In this example , two chilral carbons are at neighboring carbons. As explained earlier , Sulphur attacks internally via $\mathrm{S_N2}$ attack. Again bromide ion attacks via another $\mathrm{S_N2}$ leading to retention of configuration ( Anchimeric assistance ).
[Ref : http://www.chem.ucla.edu/~harding/IGOC/A/anchimeric_assistance.htmll]
Example 3
This example also behaves similarly to one discissed above.
[Ref: Molecules 11(4):212-8 • April 2006 DOI: 10.3390/11040212 ]
In conclusion,
If there exists no lone pair donating group at neighboring carbon to leaving group, then $\mathrm{S_N2}$ attack takes place with inversion of configuration (Example 1).
If there exists a lone pair donating group (Example 2 and Example 3)at neighboring carbon to leaving group, then retention of configuration is seen.
Inversion will only occur in the carbon in which the substitution takes place. So if the molecule was (S,S) it will become (R,S). If you analyse the Sn2 mechanism you will understand why inversion happens and you will see that there's no reason for inversion to take place in a carbon that doesn't participate in the reaction.
As Blg90 said, the inversion only occurs on the carbon involved in the substitution. I thought it would be useful, intuitively, to mention that the rear attack on the carbon to leaving group bond instigates a motion that is very much like an umbrella blowing inside out.
You can see, in this image, the hydrogens at the 'back' (which can be swapped out for any substituents that allow $\mathrm{S_N2}$), flip through the transition state to the 'front', but are themselves unaffected. Hopefully this helps you visualise why inversion only occurs at one stereogenic centre.