Prob. 4, Chap. 4 in Baby Rudin: A continuous image of a dense subset is dense in the range. Here is Prob. 4, Chap. 4 in the book Principles of Mathematical Analysis by Walter Rudin, 3rd edition: 

Let $f$ and $g$ be continuous mappings of a metric space $X$ into a metric space $Y$, and let $E$ be a dense subset of $X$. Prove that $f(E)$ is dense in $f(X)$. If $g(p) = f(p)$ for all $p \in E$, prove that $g(p) = f(p)$ for all $p \in X$. (In other words, a continuous mapping is determined by its values on a dense subset of its domain.) 

I think I can prove both of these two facts. 
Now my question is, is either of the above two results still valid if $X$ and / or $Y$ be replaced by general topological spaces? 
My effort: 

Suppose $X$ and $Y$ are topological spaces, $E$ is a dense subset of $X$, and $f$ is a continuous mapping of $X$ into $Y$. Let $q$ be any point of $f(X)$. Then this point $q = f(p)$ for some point $p$ of $X$. Let $V$ be any open set in $Y$ containing $q$. Then $f^{-1}(V)$ is an open set in $X$ containing $p$. So there is a point $a \in E$ such that $a \in f^{-1}(V)$, which implies that $f(a) \in f(E) \cap V$, from which it follows that $f(E)$ is dense in $f(X)$. Am I right?

Now for the second result: 

Suppose $X$ and $Y$ are topological spaces, $E$ is a dense subset of $X$, $f$ and $g$ are continuous mappings of $X$ into $Y$, and $g(x) = f(x)$ for all $x \in E$. Let $p \in X$. What next? 

 A: (1).One of several equivalent def'ns of continuity is that $f:X\to Y$ is continuous iff whenever $E\subset X$ and $p\in Cl_X(E),$ we have $f(p)\in Cl_Y(f(E)).$ In other words, iff $$f(Cl_X(E))\subset Cl_Y(f(E))$$ for all $E\subset X.$ 
So if $f:X\to Y$ is continuous and $Cl_X(E)=X$ then $$f(X)=f(Cl_X(E))\subset Cl_Y(f(E)) \land  f(E)\subset f(X)$$ so $f(E)$ is dense in $f(X)$ . This holds for all spaces $X,Y.$
(2).The second Q is different. If $Y$ is a Hausdorff space and $X$ is any space, and $f:X\to Y,\;g:X\to Y$ are continuous then $\{p\in X: f(p)=g(p)\}$ is closed in X. Equivalently the set $$S=\{p\in X:f(p)\ne g(p)\}$$ is open in $X.$
Proof: Let $a\in S$. There exist disjoint open subsets $U,V$ of $Y $ with $f(a)\in U$ and $g(a)\in Y.$ (Because Y is Hausdorff and $f(a)\ne g(a)).$ Now $f$ and $g$ are continuous, so there exist open sets $U',V'$ of $X$ with $a\in U'$ and $a\in V' ,$  such that $f(U')\subset U$ and $f(V')\subset V.$ Then the set $$W=U'\cap V'$$ is open in $X$ and contains $a,$ and for every $b\in W$ we have $f(b)\ne g(b).$ ( Because $f(b)\in U$ and $g(b)\in V$ and $U\cap V=\phi.)$. So $W\subset S.$
That is, for any $a\in S$ there is an open set $W$ of $X$ with $a\in W \subset S,$ so $S$ is open in $X$.
COROLLARY: Let $Y$ be Hausdorff  and let $X$ be any space. If $f,g$ are continuous  from $X$ to $Y$ and agree on a dense subset $E$ of $X$ then $f=g.$ Because $$\{a\in X:f(a)=g(a)\}=Cl_X\{a\in X: f(a)=g(a)\}\supset Cl_X(E)=X.$$ 
(3).For an example of what can occur  when $Y$ is NOT Hausdorff let $X=Y=\{0,1\}$ where the only open sets are $\phi,\{0\}$ and $\{0,1\}.$ (This is called Sierpinski space.) Let $f=id_X$ and  $g(X)=\{0\}.$ Then $f$ and $g$ are continuous and agree on the dense set $\{0\}$ but $f\ne g.$ 
There are other (more complicated) examples with  $T_1$ spaces $Y$ that are not $T_2$ spaces..
A: Regarding your first question, yes your proof is correct.
For the second question, you have to assume that $Y$ is a Hausdorff space, i.e., given any two points $x \neq y$, you can find disjoint open sets $U$ and $V$ such that $x \in U$ and $y \in V$. 
Argue by contradiction: let $f(x) \neq g(x)$ for some $x \in X$. Choose disjoint open sets $U, V$ such that $f(x) \in U$ and $g(x) \in V$. Then $$W := f^{-1}(U) \cap g^{-1}(V)$$ is open in $X$ and nonempty, because it contains $x$. Thus $W \cap E$ is nonempty, because $E$ is dense. Now, $f|W\cap E = g|W \cap E$ by assumption, contradicting that $U$ and $V$ are disjoint.
