Context. We are are working in $\mathsf{ZF}$, but my professor told we can also use (if needed) that if $X$ is at most countable, then $|\mathcal{P}^{<\aleph_0}(X)|\leq \aleph_0$ (where $\mathcal{P}^{<\aleph_0}(X)$ is the set of all finite subsets of $X$).
Problem. Given a set $X$, a function $f : X \times X \to X$ and $A \subseteq X$ such that $|A| \leq \aleph_0$, prove that there exists a subset $\overline A \subseteq X$, such that $A \subseteq \overline A$, $|\overline A| \leq \aleph_0$ and $f[\overline A \times \overline A] \subseteq \overline A$. From this conclude that every finitely generated group is at most countable.
I cannot find neither an idea to prove the first statement, nor I can see how it is related to the second question, does anyone has a suggestion?
Edit 1.: there was actually a mistake in the text, my sincere apologies to everyone who was trying to help in the comments, my bad :'-(
Edit 2.(Almost solution): Thanks everyone for the helpful suggestions! I think I've almost put all the pieces together, but there's still something left. I defined (as suggested by @ArturoMagidin) the following recursion: $$A_n := \begin{cases} A_0 = A \\ A_{n + 1} = f[A_n \times A_n] \cup A_n \end{cases}$$ and then $\overline{A} = \bigcup_{n \in \omega} A_n$. Now it's easy to check that $\overline A \subseteq X$ and $f[\overline A \times \overline A] \subseteq \overline A$, the only thing that it's causing me troubles is to prove $|\overline A| \leq \aleph_0$. An idea I've come up with is to use that the at most countable union of at most countable sets is at most countable (which is easly follow from $\mathsf{AC}$), but if I can provide an explicit sequence $(\alpha_n)_{n \in \omega}$ of enumerations for $\{A_n\}_{n \in \omega}$ (i.e. for each $n \in \omega$ $\alpha_n : \omega \to A_n$ is surjective) I can use the fact above without relying the axiom of choice.
So the main idea woud be to define the map $n \mapsto \alpha_n$ by recursion and then prove by induction that is surjective. From the hypothesis that $|A| \leq \aleph_0$ I can easily define $\alpha_0$ as a fixed enumeration, but I cannot find a good expression for $\alpha_{n + 1}$ from $\alpha_n$.
I've not found a simpler manner to prove $|\overline A| \leq \aleph_0$ so far.