As an example here, do you lose reputation if you've answered a question that has later been closed? Would Fake Name keep his 3 upvotes?
I know I ask a lot about losing/gaining rep, I'm just interested.
It's also worth pointing out that if you delete your own question or answer it will remove any gain or loss of rep that you got from it. It makes for a nice incentive for a poorly matched question or answer to be removed by the submitter to recover their reputation and improve the overall quality of the site.