Can you be a prosecuting AND defense attorney?
Only if you need a HELL of a lot of money...Actually, forget that answer...
It would be impossible to be both a prosecutor and defense attorney in the same jurisdiction at the same time. Ethical obligations would not allow it. As a prosecutor you would be privy to information that a defense attorney would not normally be privy to, and vice versa.
Generally, being a prosecutor is a full time job that would not allow you to be a defense attorney as well. However, there are part time prosecutor positions that afford attorney's the opportunity to do private work on the side. Most often, those part time prosecutors practice civil law as well (ex. wills, estates, elder law, etc.).
It is conceivable that one could be a part time prosecutor in one jurisdiction and do some criminal defense work in another jurisdiction. I guess one could work part time as a US attorney, prosecuting federal crimes and still do some private criminal defense at the local level, for example.