As long as the intellect devourer occupies the body, it knows (and can speak) the languages known by the victim and basic information about the victim's identity and personality, yet has none of the victim's specific memories or knowledge. Damage done to a host body does not harm the intellect devourer.
That final sentence - damage is done to the possessed body would suggest to me that the possessed creature would not gain DR 10/adamantine, similarly for SR - unless someone is trying to target the Intellect Devourer with a spell while it is inside someone (such as with a mind-effecting spell).
Most authoritative relevant post by a designer I've found so far: http://paizo.com/threads/rzs2n1h5?Intellect-Devourer-Body-Thief#7
Effectively the Intellect Devourer becomes the inhabited creature - besides the specific memories and knowledge called out in Body Thief. If something can be defined as knowledge or a memory then the Intellect Devourer can retain access to it while inhabiting a body. An intellect devourer's Spells may or may not fall into this category, but I would say they probably do.
I would say that an Intellect Devourer with levels of Wizard would probably retain his spells. I'm less certain about Sorcerers though.
Edit: Magnimar, City of Monuments describes a character (Kaleb) as a level 9 Wizard. It goes on to say that Kaleb is possessed by an Intellect Devourer. Unfortunately exact stats for him don't exist, but the book also describes the Intellect Devourer (Tiluatchek) as a level 9 Wizard, and describes it casting various spells not available to a regular Intellect Devourer.
To answer your specific question - if the spell targets the body, I'd use the Goblin's SR but if it targets the Intellect Devourer I'd use the Intellect Devourer's SR. Similarly for attacks against the relevant DRs.