I think there must be a mistake on the following statement (from the book Topology by James Dugundji. Chap, VIII sec, 7)
7.2 Theorem (1). The continuous image of a separable space is separable.
(2). [...]
Proof: (1). Let $f\colon X\to Y$ be continuous and $D\subseteq X$ be dense; since $Y=f(X)=f(\overline{D})\subseteq \overline{f(D)}$, $f(D)$ is dense in $Y$.
(2). [...]
My problem is with the statement $Y=f(X)$. At no point did we assume $f$ to be a surjection. Am I missing something? How can we state $Y=f(X)$?
Definition. A Hausdorff space is separable if it contains a countable dense set.
I do not know whether Dugundji gives a formal definition of "continuous image" somewhere in his book. But Theorem V 1.4 contains a text passage coming close to such a definition:
Formally we should define a space $Y$ to be the continuous image of a space $X$ if there exists a continuous surjection $f : X \to Y$.
Thus you are right, he should have written
But I think Dugundjis's omission of "surjection" is a forgivable sin.