Let $R=\mathbb{Z}[X,Y]$. I'm trying to construct an exact sequence of $R$-modules $$ 0\to R\stackrel{f}{\to} R\oplus R\stackrel{g}{\to} R\stackrel{h}{\to}\mathbb{Z}\to 0 $$
where $h(p(X,Y))=p(0,0)$.
I think $\ker(h)$ is the set of all polynomials with $0$ constant term, so $\ker(h)=(X,Y)$. So I'm trying to define $g$ with $Im(g)=(X,Y)$, and since $f$ must be injective, $R\simeq\mathrm{im}(f)=\ker(g)$.
I'm having trouble coming up with $f$ and $g$. I thought of defining $g$ to be the map which sends $(p(X,Y),q(X,Y))$ to $q(X,Y)$ without its constant term. So $Im(g)=(X,Y)$, but then $\ker(g)=R\times\mathbb{Z}$. I'm not sure if there is a way to map $R$ onto $R\times\mathbb{Z}$ isomorphically?
This is called the Koszul resolution of the $R$-module $\mathbb{Z} \cong R/(X,Y)$. The map $g$ should be defined as $g(p, q) = pX + qY$, and so $f$ must be defined as $f(p) = (-pY, pX)$. You can check directly (e.g. using polynomial division) that this defines an exact sequence.
(Note: in general, this works because $(X,Y)$ is a regular sequence on $R$, and the Koszul complex gives a canonical resolution of the quotient by a regular sequence.)