The sequence of the book that the question is asking about is in chapter 6. In terms of plot, Winston's memories of the event serve as a way to foreshadow his eventual affair with Julia as a way to rebel against the Party. In terms of character development, this chapter serves as a way to show readers Winston's ever growing dissatisfaction with the Party. The chapter shows that his anti-Party feelings are growing. The feelings that caused him to write "Down with Big Brother" in his journal were not a mistake or a one-time event.
Winston's recollection of his time with the prostitute causes him to mentally admit to his readers that what he wants most is to actively defy the Party. He sees sex as a possible way to do this. During his reminiscing, Winston tells readers that the Party made it a priority to remove all passion, joy, and pleasure out of the sexual act; therefore, having passionate sex with a Party member was a legitimate way to rebel against the Party.
Its real, undeclared purpose was to remove all pleasure from the sexual act. . . . The women of the Party were all alike. Chastity was as deep ingrained in them as Party loyalty. By careful early conditioning, by games and cold water, by the rubbish that was dinned into them at school and in the Spies and the Youth League, by lectures, parades, songs, slogans, and martial music, the natural feeling had been driven out of them. . . . And what he wanted, more even than to be loved, was to break down that wall of virtue, even if it were only once in his whole life. The sexual act, successfully performed, was rebellion. Desire was thoughtcrime.
Unfortunately, Winston's encounter with the prostitute is just as passionless as the Party intends sex to be. The act doesn't fulfill his desire for emotions and feelings. Writing about the event isn't therapeutic to Winston either.
He had written it down at last, but it made no difference. The therapy had not worked. The urge to shout filthy words at the top of his voice was as strong as ever.
By the end of the chapter, readers get a much clearer picture of how desperate Winston is getting to do something to defy the Party.
Winston's encounter with the prostitute is one of the events that foreshadows his eventual failure and destruction. It shows that Winston is driven by instinct and feeling as much as by reason, and that he can be tempted by his mere physical desires into taking actions that put him at risk for no real long-term advantage. It is a precursor of his sexual relationship with Julia, which although a much more attractive and healthier affair, was equally imprudent if Winston were really interested in resisting the rule of the Party effectively.
As his name indicates ("Winston Smith," from the hero Winston Churchill and the most ordinary of surnames, Smith), the protagonist of Nineteen Eighty-Four is presented as a very mixed bag of good and bad qualities. The prostitute incident is an early alert to the reader of one of his greatest flaws and a warning that he is doomed to fail because of his own inadequacy.
It reveals a jumbled mixture of things. It reveals how sexually frustrated he was/is, since there is nothing romantic or erotic in the meeting, but they have sex anyway. It reveals that he is taken in by the trappings of femininity: he mentions that it was the make-up that he found sexually exciting. It shows how vividly he remembers this, since he writes about all the details. Finally, it reveals that he's ready to rebel against the party