Surjective ring morphism $f:R\to R$ satisfies Ker$(f^{n+1})\subset $ Ker$(f^n)$ then $f$ is injective. As in the title, the set-up of the problem is as follows: $f: R\to R$ is a surjective ring homomorphism and $R$ is a commutative ring. Suppose that for some $m\in \mathbb{N}$, Ker$(f^{m+1})\subset$ Ker$(f^m)$. Prove that $f$ is injective.
Here are my thoughts so far: We know by the first isomorphism theorem (since $f$ is surjective) that there is an isomorphism $\phi_n: R \to R/\text{Ker}(f^n)$ for any $n\in \mathbb{N}$. Now consider the map
$$
R \longrightarrow^{f^{m+1}} R \longrightarrow^{\pi_m}R/\text{Ker}(f^n)\longrightarrow^{\phi_m^{-1}} R.
$$
Now the above composition is an isomorphism by our hypotheses and I would like to conclude that the map agrees with $f$ but I don't see why this should be true (in fact I know that it shouldn't be in general but I feel that I am on the right path).
I would appreciate a hint or some guidance on how to make my solution more complete. This is not a HW question (it is a problem on this practice qualifying exam).
 A: edited to hide a full solution in case you just wanted a hint:
I think it might be more straightforward to work from first principles. While I think your solution could work, I find it easier just to use the definition of the kernel. The key is that your assumption gives you an inclusion $\text{ker}(f^{m+1})\subset\text{ker}(f^m)$, but there is always the reverse inclusion $\text{ker}(f^m)\subset\text{ker}(f^{m+1})$ since $f$ is a ring homomorphism and must map 0 to 0. When you have these two inclusions together, you get that $f^m(R)\xrightarrow{f}f^{m+1}(R)$ is not just surjective but also injective. Once you convince yourself of this, try to conclude that if this restriction of $f$ is injective then so is $f$ itself.

By assumption, $\text{ker}(f^{m+1}) = \text{ker}(f^m)$, so the restriction $f|_{f^m(R)}$ is injective since $f\circ f^m(x) = 0$ implies that $f^m(x) = 0$ for every $x\in R$. However, $f$ is surjective, so all of its iterates must be surjective as well. Then the restriction $f|_{f^m(R)}$ is actually just $f$ itself. Therefore, $f$ is injective.

