Show that the rank of f composed with f is strictly less than the rank of f if and only if Ker(f) ∩ Im(f) is not equal to {0}.
We understand the situation and have a few examples of functions where this is true, but do not understand how to thoroughly prove this.
Let $f'$ be the restriction of $f$ to $\DeclareMathOperator{\Im}{Im}\Im f$. Of course, $\Im f'=\Im(f\circ f)$. Now $\ker f'=\ker f\cap\Im f$, hence the rank-nullity theorem implies that $\Im f'=\Im f$, i.e. $\;\DeclareMathOperator{\rk}{rank}\rk(f\circ f)=\rk f$, if and only if $\ker f'=0$.