Let $R = \mathbb Z[X,Y]$. Construct an exact sequence of $R$-modules $$0 \to R\to R\oplus R \to R\xrightarrow{f} \mathbb Z \to 0,$$ where $f(g(X,Y)) = g(0,0)$ for all $g \in R$. Here $\mathbb Z$ is viewed as an $R$-module via $X\cdot 1 = Y\cdot 1 = 0$.
The only choice of $f$ is to actually define $f(g(x,y)) = g(0,0)$ for all $g \in R$, and it can easily be verified that this $f$ is surjective and is an $R$-module homomorphism. I am not sure how I can find the appropriate maps $f_1: R \to R \oplus R$ and $f_2 : R \oplus R \to R$ that makes the above sequence exact. I thought of defining the map $f_1$ to be $g \mapsto (g,0) \in R \otimes R$ and $f_2$ to be $(g,h) \mapsto xh(x,y)$, but this does not work since (for example) $y \in \ker f = \{ g(x,y) \in R \mid g(0,0) = 0 \}$ but $y \not\in Im f_2$. I get a similar result if I define $f_2$ to be $(g,h) \mapsto yh(x,y)$.
Is there anything I can do?
EDIT: Thanks to @morrowmh, here is a solution:
Let $f_1(1) := (y,x)$ and extend the definition of $f_1$ to the whole domain $R$ as to make $f_1$ an $R$-module homomorphism, i.e. $f_1(h(x,y)) = (h(x,y)y, h(x,y)x)$. Define $f_2((1,0)) := x$ and $f_2((0,1)) := y$ and extend the definition of $f_2$ to its whole domain $R \oplus R$ as to make $f_2$ an $R$-module homomorphism. Then we may check that the sequence thus defined is an exact sequence.