If is not dense then there is a nonempty open set disjoint from . You will need to use something like Urysohn's lemma to get a nonzero function that vanishes on . Then for all .

For the converse, if is dense in then any nonzero function must be nonzero at some point . Use Urysohn's lemma again, to show that there is a function with . That will show that is essential.