Suppose $A,B$ are $L$-structures and $f:A\to B$ is a homomorphism. I'm trying to show that if $t(x)$ is a term, then $f(t^A(a))=t^B(f(a))$.
Suppose $t(x)=x_i$. Then $f(t^A(a))=f(a_i)$ and $t^B(f(a))=t^B(f(a_1),\dots,f(a_n))=f(a_i)$, so we are done.
Suppose $t(x)=c$ so that $t^A(a)=c^A$. Then $f(t^A(a))=f(c^A)$. Is $t^B(f(a))=c^B$? Why are these two equal?
Suppose $t(x)=F(t_1(x),\dots,t_n(x))$. Then $$f(t^A(a))=f(F^A(t_1^A(a),\dots,t_n^A(a))).$$ Also $$t^B(f(a))=F^B(t_1^B(f(a)),\dots,t_n^B(f(a)).$$ Am I supposed to use the induction hypothesis? For each $i$, $f(t_i^A(a))=t_i^B(f(a))$. Even if I use this, I don't see why the above two are equal.