Compactly supported functions L2 functions are dense in L2(R3), so it suffices to prove that S∩L2(R3) is dense for such functions.
Let f∈L2(R3) have compact support. Set I=∫fdx and R>0 be such that the support of f is contained in B(0,R). Let σ denote the surface measure on the unit ball S2 so that ∫S2dσ=4π. Thus, by polar coordinates,
m(B(0,a))=∫0a∫S2r2dσdr=34πr3.
Fix ε>0. Set g=f on B(0,R) and for R≤∣x∣≤M (where M>R will be chosen later), let g=−Iε (it's only important that g has the opposite sign of I on this interval). Then
∫gdx=∫fdx−∫B(0,M)∖B(0,R)Iεdx=I−34πIε(M3−R3).
Pick M=(R3+4πε3)1/3, i.e., so that ∫gdx=0. Thus, g∈S and because f∈L2(R3) and g is bounded on R≤∣x∣≤M, g∈L2(R3) as well. Finally,
∥f−g∥L22=∫B(0,M)∖B(0,R)I2ε2dx=m(B(0,M)∖B(0,R))I2ε2=34π(M3−R3)I2ε2=I2ε.
Since I is independent of ε, we may send ε→0, and that gives the claim.