The center of a ring A, written C(A), is $\{a \in A | ax=xa \text{ for all } x \in A\}$.
Since f is a ring homomorphism, we have f(ax)=f(xa) and f(a)f(x)=f(x)f(a), where $a \in C(A)$ and $x \in A$. Since f is onto, f(a) should be contained in the center of B.