The variety generated by a free algebra I am working on the following problem:
Take a free algebra $\mathcal{A}$ (on some signature $\mathcal{L}$) with set of generators $G$ and consider every other $\mathcal{L}$-algebra, say $\mathcal{B}$, such that $\mathcal{A}$ has the universal mapping property with respect to $\mathcal{B}$ over $G$. By the universal mapping property, I mean that any map 
$$h:G\rightarrow B,$$
where $B$ is the universe of $\mathcal{B}$, can be extended to a homomorphism 
$$\tilde{h}:\mathcal{A}\rightarrow\mathcal{B}$$
such that $\tilde{h}(g)=h(g)$ for any $g\in G$.
Let $\mathbb{K}$ denote the class containing any such $\mathcal{B}$, first I have to prove it is a variety and I had no problem with that, so in what follows we can assume it is closed under direct products, taking substructures and homomorphic images. Then, I have to prove that if $G$ is infinite then $\mathbb{K}$ is contained in the variety generated by $\mathcal{A}$ and give an example of why this shouldn't be true if $G$ is, instead, finite.
My idea was to take $\mathcal{B}\in\mathbb{K}$ and construct an isomorphism with some substructure of a quotient by $\mathcal{A}^G$ by an appropriate ultrafilter, for example, the one containing all the co-finite sets of $G$. However, I'm not really sure on how to proceed so any idea is greatly appreciated.
 A: This is much easier to think about in terms of equations.  If $\mathcal{B}$ is not in the variety generated by $\mathcal{A}$, then there is some equation $t(x_1,\dots,x_n)=u(x_1,\dots,x_n)$ (where $t$ and $u$ are terms) which is always true in $\mathcal{A}$ but is not always true in $\mathcal{B}$.  So, let $b_1,\dots,b_n\in B$ be a counterexample to this equation in $\mathcal{B}$.  Can you use them to find a map $h:G\to B$ which does not extend to a homomorphism?  What could go wrong if $G$ is not infinite?
More details are hidden below.

 Just take any map $h:G\to B$ which contains all of $b_1,\dots,b_n$ in its image.  If $h(g_1)=b_1,\dots,h(g_n)=b_n$, then $h$ cannot extend to a homomorphism since $t(g_1,\dots,g_n)=u(g_1,\dots,g_n)$ but $t(b_1,\dots,b_n)\neq u(b_1,\dots,b_n)$.

 Of course, this only works if $G$ has at least $n$ elements, which is why we need $G$ to be infinite.  To get a counterexample when $G$ is finite, we would want a structure $\mathcal{B}$ which satisfies all equational axioms true in $\mathcal{A}$ which involve at most $|G|$ variables, but fails to satisfy some equational axiom with more than $|G|$ variables.  Can you find such an example?  (Hint: Try really simple examples!)

One possible counterexample is hidden below.

 Just take the empty signature and $G=A$ to be a singleton.  Then it is easy to see that $\mathcal{A}$ has the universal mapping property for all algebras, but $\mathcal{A}$ satisfies the equational axiom $x=y$ which is not true in any algebra with more than one element.

