Question
Show that if $f :R\rightarrow S$ is a homomorphism, and if $a$ is a unit of $R$, then $f(a)$ is a unit of $S$. Show, in fact, that $f(a^{−1}) = f(a)^{−1}$ for any unit $a$ of $R$.
Attempt
Let $f:R\rightarrow S$ be a homomorphism. Then
$$ f(a)=f(a\cdot 1_R)=f(a)f(1_R),$$
so
$$ f(1_R)=\frac{f(a)}{f(a)}=1_S, $$
which is me trying to show why $(6)$ holds:

Consequently, we then have that,
$$ f(a\cdot a^{-1})=f(a)f(a^{-1})=f(1_R)=1_S, $$
so it is then easy to see that because $f(a)f(a^{-1})=1_S$, then $f(a)$ is a unit in $S$. Furthermore, by the same equality
$$ f(a^{-1})=\frac{1_S}{f(a)}=f(a)^{-1}, $$
as needed.
Hint: if $a\in R$ is a unity then you can write $1_R=a\cdot b$. Use the fact that $f(1_R)=1_S$ and compute $f(a\cdot b)$.