In Supernatural season 04 episode 19 Jump the shark the body of Adam Winchester was cremated by Dean and Sam at the end. But in the final of season 05 Swan song he has been shown coming out of the grave. And later Michael possesses his body. How his body was in the grave?
The angels brought him back, body and all - which apparently they can do.
You correctly point out that he was cremated by his brothers, Sam and Dean. In Point of No Return we see his return:
He awakens in the ground near where his funeral pyre was. Castiel brings him to Bobby's house where he converses with Sam and Dean about why he is back:
DEAN So why don't you just tell us everything? Start from the beginning.
ADAM Well, I was dead and in Heaven. 'Cept it—it uh, kinda looked like my prom and I was making out with this girl, her name was Kristin McGee--
DEAN Yeah, that sounds like heaven. Did you get to third base?
SAM Just uh, just keep going.
ADAM Well, these…these angels, they popped out of nowhere, and they tell me that I—I'm chosen.
SAM For what?
ADAM To save the world.
DEAN How you gonna do that?
ADAM Oh, me and some archangel are going to kill the devil.
DEAN What archangel?
ADAM Michael. I'm his uh, sword or vessel or something, I don't know.
// skipper dialogue
ADAM They said the fight might get pretty hairy, but it is the devil, right? So we got to stop him.
So he was pulled from heaven to be the vessel of the archangel Michael. He had to be given form first, so the angels gave him his body back (which apparently they can do). He was then supposed to say yes to them - although we later learn this was all an elaborate ruse designed to lure Dean into a situation where he had to agree to being Michael's vessel.