The function needs to be surjective (consider the exponential map). The definition you have is equivalent to the definition of every ball containing an element of E (which is much easier to work with). So suppose that is continuous and surjective, and E is dense in X. Let B be an open ball in Y, then is open in X (continuity), thus and hence (surjection).