He didn't, necessarily.
As has been pointed out in the comments, there were several clues surrounding his revival that could easily have led him to glean the truth: he woke up in a vat of goo surrounded by other heroes, not in a hospital, and one of the first things he saw was (the head of) a statue of himself.
However, he might not even have pieced it together. The words "you won't let me die" don't necessarily imply that he was already dead. He knew that Doomsday had mortally wounded him, and would have expected to die; not being allowed to die isn't the same as not being allowed to remain dead. For reference, consider this exchange from The League of Extraordinary Gentlemen:
Quatermain: Well, a witch doctor did bless me once. I had saved his village. He said Africa would never allow me to die.
Gray: But you're not in Africa now.