Please help me understand how to add AC power to my DC device
Broadly speaking there are two options. The simplest is to use a jack with a switch in it. When you plug it in, it disconnects the batteries. The downside of that is that it doesn't provide automatic changeover. If the mains power fails your device remains off until the plug is removed. 

Secondly, you could use logic of some kind. Since your AC adapter is higher voltage than the batteries (about 1.65V per cell for fresh alkalines or 4.95V total) , you could use two diodes. Schottky diodes (eg. 1N5817) would be preferable to minimize the drop. That will give you automatic changeover. 







simulate this circuit &ndash; Schematic created using CircuitLab

You can also do something like this with a 5V relay and a flyback diode. (add a series switch on the battery or on the output depending on what you want, the relay will consume power when the mains is present regardless): (the voltage drop is very low compared to the diodes). 







simulate this circuit

The device being powered is left "off" for a brief time while the relay switches (a few milliseconds typically). If that's a problem then you might be able to add some capacitance to the output. Many devices won't even notice.