I want to cap these wires with a wire nut so that I can stuff them back up in the ceiling and install a regular, battery-powered smoke alarm. What wires get capped and do I need to do anything with the ground wire seen up in the hole in the ceiling?
All three wires get capped separately with wire nuts. You need to cap the neutral (white) wire because it can carry current from another part of the circuit. Wrapping the nut in electrical tape is a good idea too. They make nuts that are good for holding a single 12-gauge or 14-gauge wire (the ones I have are dark blue).
You don't need to do anything special with the ground wire, just be careful when you're pushing the other wires up into the box that you don't accidentally touch it to bare copper on one of the other wires.
Also remember that electrical junctions have to be accessible. In your case, this would probably mean covering the hole in the ceiling with a blank face plate and installing the battery-powered detector somewhere else: I don't think you can use the base plate for the new detector as the cover. I would also be concerned about drafts through that hole reducing the effectiveness of the detector.