Let $\phi, \psi$ be two homomorphisms $A\rightarrow B$ of algebras $A$ and $B$. Prove $E = \{a\in A : \phi(a) = \psi(a)\}$ is a subalgebra of $A$.
I'm not quite sure what I even have to show. In my notes it says that the algebra $B$ is a subalgebra of $A$ if $A \subset B$ (is that backwards? I feel like it should be $B \subset A$) and all operations $f_B$ of $B$ are the restrictions of the corresponding operations $f_A$, but I think I found online that I just need to show that the product of any two elements of $A$ is in $A$. I obviously prefer to use the definition from class, but it is way more confusing.
I think the way to approach this is to take two elements $b,c \in E$ then $\phi(b) = \psi(b)$ and $\phi(c) = \psi(c)$. We know that since $\phi$ and $\psi$ are homormorphisms they preserve all operations so for any $f$ we have $\phi(f(b)) = f(\phi(b)) = f(\psi(b)) = \psi(f(b))$. I have no idea what to do.
Then for part b, we are asked to show that if $X \subset A$ generates $A$ and $\phi(a) = \psi(a) \forall a \in X$ then $\phi = \psi$.
I think this can be done by contradiction, i.e. suppose that $\phi \neq \psi$. Then there exists $b \in A$ such that $\phi(b) - \psi(b) \neq 0$. Since $A$ is generated by $X$, $b$ can be written as some combination of elements $x_i \in X$. I'm not sure I understand what that looks like so I may be wrong from here on out. Then $\phi(b) = \phi( \sum{c_ix_i}) = \sum{\phi(c_ix_i)} = \sum{c_i\phi(x_i)} = \sum{c_i\psi(x_i)} = \sum{\psi(c_ix_i)} = \psi(\sum{c_ix_i}) = \psi(b)$
For the first part, you need to show that if $f$ is an $n$-ary operation on the type of these algebras, and $a_1,\ldots,a_n\in E$, then $f(a_1,\ldots,a_n)\in E$.
But in these conditions, \begin{align} \phi(f(a_1,\ldots,a_n)) &= f(\phi(a_1),\ldots,\phi(a_n))\tag{$\because\phi$ is a homomorphism}\\ &= f(\psi(a_1),\ldots,\psi(a_n))\tag{$\because a_1, \ldots, a_n \in E$}\\ &= \psi(f(a_1,\ldots,a_n)),\tag{$\because\psi$ is a homomorphism} \end{align} whence $f(a_1,\ldots,a_n)\in E$.
For the second part, if $b \in A$, arbitrary and $A$ is generated by $X$, then there exists a term on the type of $A$ (a composition of fundamental operations) such that $$b = t(a_1, \ldots, a_k),$$ with $a_1, \ldots, a_k \in X$. With a reasoning similar to the previous one, you can conclude that $\phi(b)=\psi(b)$ (you must understand that homomorphisms preserve compositions of the operations, so they preserve term functions).