Psychological scientists often cite works of fiction as sources of inspiration. In some cases, literary examples are used as illustrations of the phenomenon of interest. In others, researchers set out to test the hypotheses that are proposed or implied in fictional works.
Golding's Lord of the Flies and Zimbardo's research on deindividuation
For example, Zimbardo notes that his research on the effects of deindividuation in the late 1960s (Zimbardo, 1969) was inspired by literature:
"Ideas for my first experiments in human aggression came from discussions we had in a research seminar about Golding's Lord of the Flies."
The Macbeth effect
Shakespeare is frequently cited as a source of inspiration. As one example, Zhong and Lilienquist (2006) have investigated whether sinful behavior prompts the need for physical cleansing - the "Macbeth effect", named after Shakespeare's Lady Macbeth who is compelled to wash her hands because of the crimes she and her husband have committed.
The Proust phenomenon
In the famous Madeleine Episode of Marcel Proust's "À la recherche du temps perdu", the narrator describes that the sensory perception of a tea-soaked madeleine has the power to elicit detailed and affectively-laden memories of a distant past. This hypothesis, which some call "the Proust phenomenon" has prompted a variety of empirical investigations. For example, in two experiments conducted by Chu and Downs (2002) "odor-cued autobiographical memories were reliably different in terms of qualitative ratings and reliably superior in the amount of detail yielded". (Also see this earlier question.)
Chu, S., & Downes, J. J. (2002). Proust nose best: Odors are better cues of autobiographical memory. Memory & Cognition, 30, 511–518. doi:10.3758/BF03194952
Zhong, C.-B., & Liljenquist, K. (2006). Washing away your sins: Threatened morality and physical cleansing. Science, 313, 1451–1452. doi:10.1126/science.1130726
Zimbardo, P. (1969). The human choice: Individuation, reason, and order vs. deindividuation, impulse, and chaos. In: Arnold, W.J. and Levine, D. (eds). Nebraska Symposium on Motivation, Lincoln:University of Nebraska Press, 237-307.