It cost the individual nothing. Yes building the temples themselves probably costs the church a considerable amount, but it also costs other churches a considerable amount to build their places of worship as well. I misread your statement though and thought you were asking how much each individual pays, which is zero.
But what about this baptism by proxy? Do you know anything about that?
You actually pretty much answered that question in your post. One of our temple ordinances is baptism for the dead in which those that have not been baptized for whatever reason can receive baptism. Baptism for the deceased is done by proxy.
The church also gathers geneological data not only for temple services but also so that members can learn about their ancesctors.
For example without that geneology I would not have learned about my families immigration to the US and their migration westward. I'm only second generation LDS so my family did not come west via the Mormon migrations but were homesteaders, pony express riders, confederate soldiers, yankee soldiers, fought for the British in the revolution (sorry for that btw :) ), etc etc. I *might* have been able to learn my family history without the LDS church but the church made it much easier.
Non-members are allowed to the LDS geneology library and use the churches geneology resources for their own family history research btw.