Oh my! Should we all go to the Mormon church to figure that one out? We'll start baptizing people on behalf of people who have died, you know, "proxy baptisms" for the benefit of dead people!
But if you just back up and see that Paul is making a big deal about how ridiculous it is that "some of you say that there's no resurrection of the dead" (1 Cor 15:12), and then he poses some absurd consequences of such an idea, pointing out that if it were true, then
"...there is no God..." (Psalm 14:1)Look it up and see for yourself. The bible says "there is no God"! That is a word for word quote from the bible.
So, the answer is that the proposition, taken out of context, is ridiculous. No one is "baptized for the dead." It is yet another facetious statement by Paul to those who are suggesting that there is no resurrection.
The English translations don't really bring out the simplicity of the statement. The preposition is not really "for" but literally "over":
επει τι ποιησουσιν οι βαπτιζομενοι υπερ των νεκρων ει ολως νεκροι ουκ εγειρονται τι και βαπτιζονται υπερ των νεκρωνTranslated, hyper-literally,
epei ti poiesousin oi baptizomenoi uper ton nekron ei olos nekroi ouk egeirontai ti kai baptizontai uper ton nekron
thereupon what/any/who shall be doing, the being-immersed over the dead, if altogether dead are not being roused, what/any/who and/also are being immersed over the deadβαπτιζομενοι υπερ των νεκρων is literally "being immersed over the dead" (verb participle, present tense)
The key word is υπερ ("[h]yper") which literally means "over" but can obviously mean other figurative things, just like in English.
However, in this case just read it literally at face value: "Over"
I'll quote the verse from the NASB'95, but substitute "over" for "for":
Otherwise, what will those do who are baptized over the dead? If the dead are not raised at all, why then are they baptized over them?"The ridiculous proposition that the apostle Paul is posing should now be even more obvious:
They are immersing people, including by water baptism, which is a picture of death, burial, and resurrection, and that is actually, literally, physically happening "over" all these dead people who are literally buried under the ground, whom some of these people at Corinth are saying will never rise, because they are saying "there is no resurrection."
So, if they say "there is no resurrection," then what's the point of "immersing/baptizing" anyone at all? In particular, in water baptism, the act of baptism also involves pulling them out of the water, representing resurrection!
I grant this work to the public domain.