When NaI is in acetone and we have R-X, then I replaces X by Finklestein mechanism (Sn2 => Inversion). But when we have acetone and water, why do we get a racemic mixture?
NaX (X = Cl, Br) is insoluble in acetone, but is soluble in water. So, if you have water/acetone system, the solubility of NaX is increased comparing to acetone. Solvation effect doesn't have a big role on iodide ions and does not greatly impact it's nucleophilicity. So, the mechanism is still going to follow SN2 path. So, after one halogen is displaced by I-, you have introduced a better leaving group in the substrate. Then, another iodide is going to attack the newly formed R-I, so the result is: 2 x inversion = configuration retention. As no NaX precipitate forms, it is better for I- to attack RI than RX. It turns out that after equilibrium is reached, you end up with racemic mixture, or something close to racemic mixture. Note that free iodide ions keep attacking R-I and that this is a dynamic process which constantly repeats in the solution.