[guided]The point of using ranks is that contraction has a clean rank formula. Let $r_M$ be the rank function of $M$. If $N$ is any matroid, $g \in E(N)$, and $A \subset E(N)\setminus\{g\}$, contraction by $g$ satisfies
\begin{align*}
r_{N/g}(A) = r_N(A\cup\{g\}) - r_N(\{g\}).
\end{align*}
This remains valid under the loop convention. Indeed, if $g$ is a loop in $N$, then $r_N(\{g\}) = 0$, and adding $g$ to a set cannot increase rank, so $r_N(A\cup\{g\}) = r_N(A)$. Hence the formula becomes $r_{N/g}(A) = r_N(A)$, which is exactly the rank function of $N\setminus g$ on $A$.
Now fix an arbitrary subset $A \subset E\setminus\{e,f\}$. We compute the rank of $A$ in $(M/e)/f$. First apply the contraction formula inside the matroid $M/e$, with the element being contracted equal to $f$:
\begin{align*}
r_{(M/e)/f}(A) = r_{M/e}(A\cup\{f\}) - r_{M/e}(\{f\}).
\end{align*}
Each term on the right is now a rank in $M/e$, so we apply the contraction formula again, this time for contraction of $e$ in $M$. Since $A\cup\{f\}$ is a subset of $E\setminus\{e\}$, we have
\begin{align*}
r_{M/e}(A\cup\{f\}) = r_M(A\cup\{e,f\}) - r_M(\{e\}).
\end{align*}
Similarly,
\begin{align*}
r_{M/e}(\{f\}) = r_M(\{e,f\}) - r_M(\{e\}).
\end{align*}
Substituting these two identities into the previous display gives
\begin{align*}
r_{(M/e)/f}(A) = \bigl(r_M(A\cup\{e,f\}) - r_M(\{e\})\bigr) - \bigl(r_M(\{e,f\}) - r_M(\{e\})\bigr).
\end{align*}
The two occurrences of $r_M(\{e\})$ cancel, leaving
\begin{align*}
r_{(M/e)/f}(A) = r_M(A\cup\{e,f\}) - r_M(\{e,f\}).
\end{align*}
The same computation with $e$ and $f$ interchanged gives
\begin{align*}
r_{(M/f)/e}(A) = r_M(A\cup\{e,f\}) - r_M(\{e,f\}).
\end{align*}
Since $A$ was arbitrary, the two rank functions agree on every subset of the common ground set $E\setminus\{e,f\}$.[/guided]