Rhetoric is the art of persuasion in speech and writing. It relies on developing logical and sometimes manipulative arguments in order to persuade a listener or audience. One technique used in rhetoric is called pathos, which is when the speaker appeals to the emotions or sympathies of the audience. An example of this would be if a politician addressed a crowd of middle class citizens and described the hardships she had to go through as a middle class citizen herself.
Ethos is another technique where the speaker, or writer, appeals to the character and beliefs of her audience. Logos is a much broader term which, in this context, means a reasoned, logical argument. Other rhetorical skills are figures of speech, literary references, and repeated phrases which is similar to the refrain in a song or a prayer.
In Hamlet, there is a lot of rhetorical play, but Hamlet himself is the master of rhetoric. Hamlet is, at times, "playing" or acting mad; he changes his behavior and speech in order to manipulate the other characters. He uses rhetorical strategies in this way, but he also uses them to justify his actions. When he tells Gertrude, he must be "cruel to be kind" (III.iv.178), he tries to sympathize with her frustration at his actions.
Certainly, Hamlet's soliloquies are moments when he shows his real rhetorical flourish. These are the moments when he is convincing himself (and the audience) what he should do and how he should act.
In a rhetorical reversal, in Act I, Scene ii, Hamlet seeks sympathy (from God, fate, and the audience) for his own plight, blaming his mother (in addition to Claudius) for his (Hamlet's) depressed state.
Within a month,
Ere yet the salt of most unrighteous tears
Had left the flushing in her galled eyes,
She married. O, most wicked speed, to post
With such dexterity to incestuous sheets! (I.ii.156-160).
As with other Shakespearean characters, Hamlet's speech is poetic, which tends to appeal more to the emotions than a plain, logical argument. And although we never really know how much Gertrude is to blame, Hamlet's arguments are always philosophically and logically well reasoned.
In colloquial speech today, when someone says a question is rhetorical, they mean that they were not seeking an answer. A rhetorical question is actually a figure of speech where the speaker asks a question to make a point; not in expectation of an answer. When Hamlet asks "to be or not to be," he is considering his own existence, but he is philosophizing, constructing an argument to himself (and the audience) about whether it is nobler to face the struggles of his life or to die. It is in this speech that Hamlet looks for his own persuasive, or rhetorical, argument about what he should do.