When you've done your duty, you've done what you're supposed to and met your responsibilities. Your sense of duty as a citizen might compel you to vote; it might also keep you from voting twice.
A duty is an obligation, and we get new duties with new positions in life, like taking a job, or becoming a parent. You didn't realize one of your duties as club president would be cleaning up after meetings. A police officer or cab driver can be on-duty or off-duty. As an off-duty police officer, you might still feel it's your duty to stop a robbery. Duty also means "tax," which is why people like shopping duty-free at the airport.