What are the similarities and differences between "The Yellow Wallpaper" and The Scarlet Letter?
These are two very disparate pieces of literature. Aside from the former being a short story and the latter a novel, both take place within two very different times: The Scarlet Letter is a novel that deals with Puritan life in Massachusetts in the 1600s, while "The Yellow Wallpaper" takes place in a colonial mansion (perhaps in Providence, Rhode Island) in the late 19th-century. In terms of setting, both are New England tales.
Gilman wrote the "The Yellow Wallpaper" during what was probably her own experience of what we now call post-partum depression. The tale was a reaction to medical science's explanations for emotional disturbances among women, and particularly accepted cures for "hysteria." In Gilman's case, her doctor recommended that she embrace all things domestic. She creates a character in her story who does exactly this. The result is that she goes mad, but also experiences a lucid epiphany: she is imprisoned by domesticity.
It is important, too, that "The Yellow Wallpaper" is narrated by a female protagonist. Nathaniel Hawthorne, on the other hand, creates a third-person omniscient narrator who tells the story of Hester Prynne.
The only way in which the works are similar is in their explorations of female identity, and the ways in which women have been oppressed by the social expectations of certain times. Of course, in The Scarlet Letter, Hester's transgression is a flagrant one, even by modern standards: she commits the sin of adultery and has a child as a result of the encounter. In Gilman's story, the struggle is that of a woman who wants to write, but is discouraged by her doctors and her husband, John. Both female characters wish to live according to their own desires, a wish that is socially unacceptable.
If you are going to do a comparative analysis of these works, I would consider giving both a feminist reading. With "The Yellow Wallpaper," this is easy because it is a tale with an explicitly feminist message. However, be sure to remember that Hawthorne and Gilman employ different literary devices and probably have different agendas in their telling of these stories.