Let $R$ be a commutative ring with unity and $f:R \to R$ be a ring homomorphism. If $S = \{a \in R | f(a)=a \}$, show that $S$ is subring of $R$.
My attempt:
Let $m,n \in S$. That's, $f(m)=m$ and $f(n)=n$. Let $a\in S$. Now, \begin{align*} 0_R = f(-a+a) &= f(-a) + f(a) \\ 0_R &= f(-a) + a \\ f(-a) &= -a \end{align*} Thus, $-a \in S$. Next, note that $f(m-n) = f(m) - f(n) = m - n \in S$ and $f(mn) = f(m)f(n)=mn \in S$. Hence, by the subring test above, we obtain that $S$ is subring of $R$.
Is that correct? Hope an advice or correction for my attempt above. Thanks in advanced.