a) Suppose that $f(X)$ is dense in $Y$ and that $\tilde{f}(\phi)=0$.
Then $\phi \circ f=0\Rightarrow \phi=0\ {\rm on} f(X) \Rightarrow \phi=0$ where the last step follows since morphisms are continuous wrt. the Zariski topology.
b) Suppose $X\subset A^m, Y\subset A^n$ and $f(X)$ not dense in $Y$.
By definition there exists an open set $O\subset A^n$ with $O\cap Y\not=\emptyset$ and $O\cap f(X)=O\cap Y\cap f(X)=\emptyset$.
Since $\emptyset \not=O \not= A^n$ we can write $O=\{\phi_1\not=0\}\cup
\cdots \cup \{\phi_s\not=0\}$ for a finite collection $\phi_i$ of polynomials.
Hence a polynomial $\phi$ exists with $\{\phi\not=0\}\cap Y\not=\emptyset$
and $\{\phi\not=0\}\cap f(X)=\emptyset$. Then $\phi\in \Gamma(Y), \phi\not=0$
and $\tilde{f}(\phi)=0$. Hence $\tilde{f}$ is not injective.