Like a gopher on a putting green, the question of duty just keeps popping up again and again in Foundation. And like Bill Murray, the more we see the gopher, the harder it becomes to really nail it. What we can say is that the protagonist of every story in Foundation must discover his true duty. Should Seldon promote the findings of psychohistory if it costs him his life? As mayor, should Hardin work against completing the Encyclopedia Galactica? And should your duty be toward your convictions or the state? With five different stories, we seem to get five different answers—and maybe that's for the best with such a complicated issue.
Gaal Dornick is the only character of Foundation who could be said to be duty-free. All he has to do is be at the events, so the reader can bear witness.
In Foundation, duty means using any means to accomplish an end.