This can be made slightly more general: Let $R$ and $I$ be as you say, and let $M$ be any $R$-module. There is an isomorphism
$$
M\otimes_R R/I \cong M/IM.
$$
Here's how to see it: start with the exact sequence
$$
0 \to I \to R \overset{f}{\to} R/I \to 0
$$
(note that $f$ is the same as your $f$).
Then tensor with $M$:
$$
M\otimes_R I \to M\otimes_R R \overset{f\otimes 1}\to M\otimes_R (R/I) \to 0
$$
This is exact by the right-exactness of $\otimes$. Using the natural isomorphism $M \otimes_R R \cong M{}{}{}$, this sequence is exactly
$$
M\otimes_R I \overset{\phi}{\to} M \overset{\tilde f}\to M\otimes_R (R/I) \to 0, \qquad (*)
$$
where the map $\phi$ takes a pure tensor $m\otimes x$ to $xm$ and $\tilde{f}$ takes $m$ to $m\otimes 1$. It should be clear that the image of $\phi$ is equal to $IM\subset M$.
The nontrivial step that proves the direction you need is the exactness of $(*)$ at the term $M$, which gives
$$
IM = \text{image}(\phi) = \ker(M\to M\otimes_R(R/I)).
$$
So, in the case that $I=M$, we have that
$$
I^2 = \ker(I\to I\otimes_R(R/I)).
$$
Unfortunately, I do not know of a good way to prove this by hand. This seems to rely on the right exactness of $\otimes$, and you can see some discussion here that discusses how this is proved.