Undiscovered Country is a reference to the concept of the afterlife as the "undiscovered country" from To be,  a soliloquy spoken by Prince Hamlet in the so-called "nunnery scene" of William Shakespeare's play "Hamlet".
 The title of the play is a reference to the concept of the afterlife as the "undiscovered country" from the "To be, or not to be" soliloquy in "Hamlet". 
To be, or not to be is the opening phrase of a soliloquy spoken by Prince Hamlet in the so-called "nunnery scene" of William Shakespeare's play "Hamlet". 
