This snippet, from a Guardian Review reprint of a Susan Sontag essay written just before her death in 2004, seems to me to be exactly exactly right:
I'm often asked if there is something I think writers ought to do, and recently in an interview I heard myself say: "Several things. Love words, agonize over sentences. And pay attention to the world."
Needless to say, no sooner had these perky phrases fallen out of my mouth than I thought of some more recipes for writer's virtue.
For instance: "Be serious." By which I meant: never be cynical. And which doesn't preclude being funny.
A great writer of fiction both creates - through acts of imagination, through language that feels inevitable, through vivid forms - a new world, a world that is unique, individual; and responds to a world, the world the writer shares with other people but is unknown or mis-known by still more people, confined in their worlds: call that history, society, what you will.
But of course, the primary task of a writer is to write well. (And to go on writing well. Neither to burn out nor to sell out.) To write is to know something. What a pleasure to read a writer who knows a great deal. (Not a common experience these days ... ) Literature, I would argue, is knowledge - albeit, even at its greatest, imperfect knowledge. Like all knowledge.