Christa Wolf, who has died aged 82, was a German writer of rare purity and sensitivity who grew up under nazism and became an adult under communism. Her work records the impact of these ideologies on individual lives. She was, as one critic put it, "a writer of scrupulous 'touchstone' honesty", and it is the pursuit and uncovering of truth, under the most beleaguered circumstances, that defines her.

When, in 1992, it was revealed that she had been used by the Stasi, the East German secret police, from 1959 to 1962 as an informal collaborator – inoffizieller Mitarbeiter – the ensuing attacks on her integrity practically brought her writing to a halt. That she provided no information of value, was soon dropped for "reticence", and was herself the subject of surveillance for 30 years, did not mitigate the ferocity of the attacks from "stone-throwing West Germans", as her translator, Michael Hofmann, called them.

It was argued that the writer who had done most to articulate "the difficulty of saying I" was herself little more than a state poet, a mouthpiece for the regime. Her refusal to simply exonerate herself was read as a sign of guilt, rather than for what it was: a continuation of her life's work of intense self-interrogation and reflection, in which one must "execute the verdict oneself" – as she wrote in her most important work, Nachdenken über Christa T (The Quest for Christa T, 1968) – rather than succumb to the demagogue's version of events.

Born in Landsberg an der Warthe in Brandenburg, now Gorzów Wielkopolski in Poland, to a grocer and his wife who were Protestant, middle-class and pro-Nazi, Christa Ihlenfeld was a member of the Bund Deutscher Mädchen, the female counterpart of the Hitler Youth. She was 10 years old when she watched the SS march through her town on the way to invading Poland, and 16 at the end of the second world war, when her family ran from the advancing Soviet army.

This moment of "liberation" recurs in her fiction, in Kindheitsmuster (Patterns of Childhood, 1976) – in which she tries to reconnect East Germans to a past from which they believe themselves acquitted; and in the story Blickwechsel (1970), translated as Exchanging Glances (1993), where a family snatch their belongings and flee westward toward the Oder-Neisse border. As flames rage in the night sky, the youngest daughter laughs uncontrollably at the spectacle of her resolutely bourgeois family, sellers of sour pickle and malt coffee, literally going to hell in a handcart.

When the dust settled and the maps were redrawn, the town of Wolf's birth was in Poland. Mecklenburg, where her family landed, was now part of a newly minted nation, the German Democratic Republic. She was finishing high school before she began to understand the full train of events. Against this, the GDR offered another faith. Marxism, she believed, was the polar opposite of what had happened in Nazi Germany: "At all costs I didn't want anything that could be like the past… That was the source of (my generation's) commitment and… why we clung to it so long" – something that critics in the west have often failed to grasp.

In 1949, as the GDR came into being, Wolf joined the state communist organisation, the Socialist Unity (SED) party. She studied literature at Jena and Leipzig universities, was a research assistant in the GDR writers' union, and was involved in the Bitterfeld movement of worker-writers. Her first book, Moskauer Novelle (Moscow Novella, 1961), was well received in the east but never translated in the west. Her novel Der Geteilte Himmel (The Divided Heavens) won the GDR's Heinrich Mann prize in 1963, bringing international recognition. That year too she became a candidate member of the SED central committee, and in 1965 spoke at its 11th plenum. It began a long process of disenchantment with socialism: in her view, it was not moving in the right direction.

A pattern emerged: disillusionment, followed by withdrawal and contemplation, from which she would surface with a vindicating work. "Each time… I'd moved a bit further along the road to myself."

Out of the depression she suffered after the 11th plenum, she wrote what became a feminist classic, Nachdenken über Christa T. It is an assault on patriarchal authority, and in its fragmented sensibility the novel pursues the difficult "attempt to be oneself", for which she was accused within the GDR of being individualistic. The book was banned, then published in a limited edition only.

Rather than the image of perfectibility that GDR writers were encouraged to present, Wolf set out in Christa T to imagine the life of an outsider, but she does this from inside what the GDR conceived as socialism. She was reinventing the heroic mould, or at least questioning whether this life of an outsider – marginal, hesitant, obscure – might not also be of value, full of latent possibility; might be, in fact, what orthodox GDR theorists were looking for in art: the exemplary.

Wolf continued to produce innovative work, countering crude prescriptions with her notion of "subjective authenticity" – an author should not hide behind her characters but include intertextual commentary. While her position as a loyal dissident was not easy, it was undeniably a source of strength. It is as a writer from inside what was seen as a socialist project – however distorted the GDR version of this was – that she seems so interesting, casting light on questions of philosophy, genre and form, delivering insights on the writer's inner censor, and in the process making much western writing seem too easily conformist.

Her success meant that she was allowed to travel and teach abroad, and in the 1970s she forged friendships with other women writers, consolidating her interest in feminism. A study trip to Greece brought an oddly late epiphany about the extent of her sex's marginalisation: "I… had a real shock when I realised that in the past 2,000 years women really have not been able to exert any public influence." The work that resulted from her forays into Greek myth, in novels such as Kassandra (1983) and Medea (1996), was instantly recognisable to friends in the west such as Margaret Atwood, who penned the introduction to Medea, observing that "the heroes are really like devils, and the victims are the most important".

Following a further experience of defeat over the enforced exile in 1976 of the singer-poet Wolf Biermann from the GDR, she continued her work of re-evaluating literary tradition from a specifically German context. In Kein Ort. Nirgends (No Place on Earth, 1979), she imagines a meeting between two writers, Heinrich von Kleist and the poet Karoline von Gunderrode, both of whom killed themselves in the early 1800s, as a way of examining the experience of defeat. Again, the exploration takes on greater force for being cast from inside a society whose ideology dismissed despair as a luxury.

A later work, Leibhaftig (In the Flesh, 2002), draws on her experience of illness as the dream of socialism unravelled. In 1988, as Wolf was completing Sommerstück (Summer Play), her appendix had burst, leaving her with peritonitis. The following year she resigned from the SED. Five months later she gave a speech at the Berlin Wall, then collapsed with a heart attack shortly before it came down. A few weeks later she signed the For Our Country petition, which argued against reunification – "we were thinking about preserving an entirely different country" – but history's doors were banging shut and the moment of possibility quickly passed.

Wolf ended her life in her beloved Berlin, doubly exiled in her own country and shorn of her faith, left only with Was bleibt – what remains, the title of the account of being under surveillance by the Stasi that she wrote in 1979, and that aroused considerable controversy when published in 1990. Like her friend the American writer Grace Paley, she came to believe that change would never again be born from an ideology, but progress might occur through shifts made by grassroots associations.

Her 1987 book Störfall: Nachrichten Eines Tages (Accident: A Day's News) about the Chernobyl disaster reflects some of this, with its concerns about technological advance and ecological decline, in the face of which she points to "the significance of daily structure", the reiteration of human scale. Still, the loss of the comradeship and the self-realisation that socialism had promised was hard to recover from; as was the possibility which she refused with customary honesty to dispel entirely: that one may have done wrong in its name. With all this went her abiding sense of "the abyss that yawns before us", the fear of a future with no countering vision, a world with nothing but the military-industrial complex to guide our dreams.

In recent years, as Germany has come to feel more at ease with reunification, less bedevilled by the ghosts of history, Wolf has been recognised, alongside Günter Grass, as the nation's most important postwar writer. She received the 2002 Book award at the Leipzig Book Fair, and the 2010 Thomas Mann award for her last novel, Stadt der Engel Oder the Overcoat of Doctor Freud (City of Angels or the Overcoat of Doctor Freud), based on a period of research she undertook in Los Angeles at the time of the 1992 Stasi revelations. This was a work ten years in the making and critics hailed it as her final reckoning, a courageous act of remembrance and leavetaking, a vindication, Die Welt argued "of the ordering mind's triumph over the chaos of emotion".

"A post is vacant," Wolf wrote, when her friend and sparring partner the Swiss playwright and novelist Max Frisch died in 1991. It is taken from Heinrich Heine's poem Enfant Perdu, whose first line runs, "Verlorene Posten in dem Freiheitskriege" (Vacated positions in the war of freedom). Asked later about her choice of encomium, she replied: "No one talks like that any more… The times and people's objectives have changed."

The times have indeed changed, and the terms of our struggle for freedom with them, but the need for voices such as Wolf's, which remain fully human and compassionate even under the greatest pressure and provocation, is greater than ever. In 1951 she married the writer and publisher Gerhard Wolf, and they had two daughters.

•Christa Wolf, writer and literary critic, born 18 March 1929; died 1 December 2011