The full title is "Formulations on the Two Principles of Mental Functioning," and it can be found in Volume XII of the Standard Edition of the complete works. This is the seminal paper where Freud introduces his famous "reality principle" alongside the "pleasure principle."

In Freud's view, early in life, the autoerotic mode dominates, and pleasure is found mostly within the self. However, the perpetuation of this state can lead to neuroses. In Freud's words, "every neurosis has as its result, and probably therefore as its purpose, a forcing of the pationt out of real life; an alienating [from] reality." The heteroerotic mode eventaully leads to frustration and necessitates the reality principle.

What's interesting to me is that the word "purpose" implies a teleology. Usually in the life sciences, when one uses this word, it typically refers to evolutionarily advantageous mechanisms, it is interesting to consider such benefits of neurotic or semi-neurotic unreality. (c.f. Rank, and phantasy as a way of coping with the unreality of the original birth trauma).

Freud describes the development of the reality principle as occuring gradually over time, and never completely usurping the pleasure principle. He notes that its hallmarks -- effort and delayed gratification -- are epitomized by the religious myth of the afterlife. However, Freud does not believe that the promise of security in the next life completely quells the urge for unrestrained pleasure. Neither does education, but he argues that is the next best thing.

In my opinion, the most interesting line here crops up when he applies this theory to the artist; Freud writes: "in a certain fashion he actually becomes the hero, the king... without following the long roundabout path of making real alterations in the external world."