The question is from Chapter 4 of Enderton's Elements of Set Theory. The symbol $\omega$ (omega) used in the question represents the natural numbers defined so that $0 = \varnothing$, and $0 \in 1 \in 2 \ \ldots$ etc. The full text provides:
Assume $A$ is a set and $G$ is a function, and $f_1$ and $f_2$ map $\omega$ into $A$. Further assume that for each $n$ in $\omega$, both $f_1 \restriction n$ and $f_2 \restriction n$ belong to the domain of $G$ and $f_1(n)=G(f_1 \restriction n) \space \& \space f_2(n)=G(f_2 \restriction n)$. Show $f_1 = f_2$.
But what's stopping a definition of G that has $f_1 \ne f_2$? For example, for $0$, $f_1(0)=y_1=G(\langle 0,y_1\rangle)$ and $f_2(0) = y_2 = G(\langle 0,y_2\rangle)$? Of course this will expand rapidly for each number, but since the range of $G$ must only be included in $A$ and $A$ is not defined for us, I don't see why $A$ couldn't have enough unique members to define each output in an expanding way starting with this.
Hint: See comment by William Elliot (Induction).
Extra Hint: Notice $f_1(0)=G(f_1\restriction 0)=G(f_1\restriction \emptyset)$.
Note: This is a really nice exercise as what you are really doing is showing that you can define a function recursively. And the fact that you have $\omega$ is not actually important here. It caries over nicely to arbitrary ordinals and even (I'm pretty sure) well-founded partial orders.