I am stuck with the following algebra problem:
Let $f,g\in k[x,y]$ be polynomials which generate $(x,y)$ (as an ideal). Consider the homomorphism $\phi:k[x,y]\to k[x,y]$ which is identity on $k$, and sends $x$ to $f$, $y$ to $g$. Is $\phi$ necessarily an automorphism of $k[x,y]$? (In my case $k=\mathbb{C}$, but I think it doesn't really matter)
It is of course sufficent to prove that it is surjective (then, if it had nontrivial kernel, after taking quotient we would get a one (or zero) - dimensional ring isomorphic with $k[x,y]$, contradiction). My idea was to check it locally: in $k[x,y]_{(x,y)}$ it seems to be true (although I can't prove it), but it seems not to see what's going on over the other maximal ideals (although I can't find a counterexample either).
I know that it might be a silly question, but I would be really grateful for any help.
EDIT: Simone provided below a simple counterexample. However, I think it is still interesting if we assumed additionaly that these polynomials $f,g$ are both irreducible. Is the answer still negative?
Thank you for any help.