$\mathbb{C}[X,Y]/(Y-X^2)\cong\mathbb{C}[X]$ 
Let $K$ be a field and $f(X)\in K[X]$. Then we have a well-defined
  surjective homomorphism
$$\varphi: K[X,Y]/(Y-f(X))\to K[X]$$
given by $[g(X,Y)]\mapsto g(X,f(X)$.

Someone has claimed that this is always injective, i.e. $$K[X,Y]/(Y-f(X))\cong K[X].$$
Is it true ? If so, I can't understand why $g(X,f(X))=0$ implies that $Y-f(X) | g(X,Y)$. If it's wrong, under which conditions on $f$ does it hold ?
 A: If $R$ is an arbitrary commutative ring and $a \in R$, then $R[T] \to R$, $T \mapsto a$ defines a surjective homomorphism of $R$-algebras with kernel $(T-a)$; hence $R[T]/(T-a) \cong R$. There are various ways to see the equality of kernels:
A. One may assume $a=0$ by composing with the automorphism $R[T] \to R[T], T \mapsto T-a$, but for $a=0$ the kernel contains those polynomials without constant term, i.e. which are multiples of $T$.
B. If $f \in R[T]$, we have that $T-a$ always divides $f(T)-f(a)$. It suffices to see this for $f=T^n$, but then $T^n-a^n=(T-a)(T^{n-1} + T^{n-2} a + \dotsc + a^{n-1})$. In particular, $f(a)=0$ implies $f \in (T-a)$.
C. The universal properties of polynomial and quotient rings give
$$
\begin{array}[ccc]
 h \hom (R[T]/(T-a),S)  &\cong& \{(\phi,s): \phi \in \hom(R[T],S), \phi(T-a)=0\} \\
&\cong& \{(\psi,s):\psi \in \hom(R,S),s \in S, s-\psi(a)=0\} \\
&\cong& \hom(R,S)
\end{array}
$$
naturally in $S \in \mathsf{CRing}$, hence $R[T]/(T-a) \cong R$ by the Yoneda Lemma. This is how one can see these kind of trivial isomorphisms at once without doing any calculations, even in more abstract and more complicated situations. The moral of this proof is: One adjoins a variable $T$, but declares this variable to be some given element $a$, so nothing happens at all, done.
A: Yes, these two rings are always isomorphic. Here's a concrete way to see that the kernel is what it should be:
Think of $K[X,Y]$ as $(K[X])[Y]$, i.e. think of every polynomial in $X$ and $Y$ as being a polynomial in $Y$ with coefficients in $K[X]$. Now $K[X,Y]$ is naturally a subring of $K(X)[Y]$ - polynomials in $Y$ with coefficients which are rational functions of $X$. The key is that $K(X)[Y]$ is a polynomial ring in one variable over a field, so it is a euclidean domain, i.e. we can do long division.
Given a polynomial $g(X,Y)$ with $g(X,f(X)) = 0$, we have that $f(X)$ (as an element of $K(X)$) is a root of $g$, thought of as an element of $K(X)[Y]$.
 So $(Y-f(X))$ is a factor of $g$ for the usual reason: by long division, we can write $g(Y) = q(Y)(Y-f(X)) + r(Y)$, where $r$ is of degree $0$ in $Y$, i.e. it is just a rational function of $X$. 
But now evaluating, $g(f(X)) = q(f(X))(f(X) - f(X)) + r = r$. But $g(f(X)) = 0$, so $r = 0$, and $g(Y) = q(Y)(Y-f(X))$. 
There's one more complication: You may worry that $q$ fails to have coefficients in $K[X]$ - you might have had to move to the $K(X)$ to see that $Y-f(X)|g$. But notice that $g = q\cdot Y - q\cdot f(X)$. You should be able to check from here that if $q$ were not a polynomial in $X$ and $Y$, $g$ would not be either.

An intuitive way to think about this is that quotienting $K[X,Y]$ by the ideal $(Y-f(X))$ is imposing the relation $Y-f(X) = 0$, i.e. $Y = f(X)$. So the ring $K[X,Y]/(Y-f(X))$ is "the same" as the ring $K[X]$, it just has an extra name for the element $f(X)$.
Geometrically, the isomorphism of these rings corresponds to the fact that the graph of the polynomial function $f$, which is cut out in the plane by $Y = f(X)$, is isomorphic (as varieties) to the affine line (the $X$-axis) by projecting onto the $X$ coordinate.
