After going through the process of sleeping on the cold, hard ground ... and then using a thin foam mattress ... I've now settled on a 3/4 thermarest mattress which works quite well. It also packs down small so it isn't too bulky to carry.
As far as the pillow goes, I use small inflatable pillows. I carry several of them with me and use a couple under my head, one under my knees when I lie on my back, etc. My inflatable pillows fold down almost to nothing.