Let $R$ be a ring, and let $I_1,\ldots,I_n$ be ideals in $R$ (or submodules of some $R$-module). Consider the sequence $ \bigoplus_{1\leq j < k\leq n} I_j\cap I_k\quad\xrightarrow{f}\quad\bigoplus_{l=1}^n I_l\quad\xrightarrow{g}\quad\sum_{k=1}^n I_k, $ where $g$ is given by addition, and $f$ maps $x\in I_j\cap I_k$ to $x\in I_j$ and to $-x\in I_k$ (and to zero in all other components).
Clearly, $g$ is surjective and the composition $g\circ f$ vanishes.
Question: Is the above sequence exact in the middle?
(This seems to be easy for $n=2$.)
(Concerning the title: I am aware of the fact that $f$ won't be injective in general.)