First of all I point out that if $X$ and $Y$ are two sets then the set $Y^X$ is the set of all function from $X$ to $Y$.
So in the text Introduction to Set Theory by Karel Hrbacek and Thomas Jech it is proved the following alternative version of the recursion theorem.
Theorem 3.5
For any set $S$ and any function $g:\bigcup_{n\in\Bbb N}S^n\rightarrow S$ there exists a unique sequence $f:\Bbb N\rightarrow S$ such that $$ f(n)=g(f|_n) $$ for all $n\in\Bbb N$
So using this result the same text proves that if $f:X\rightarrow Y$ is a function defined in a finite set then its immage $f[X]$ is finite too.
Theorem 2.5
If $X$ is a finite set and $f$ is a function, the $f[X]$ is finite. Moreover, $|f[X]|\le|X| $
Proof. Let $X=\{x_0,\dots,x_{n-1}\}$. Again, we use recursion to construct a finite one-to-one sequence whose range is $f[X]$. Actually, here we use the version with $f(n+1)=g(f|_n)$. We ask the reader to supply the details; the construction goes as follows: $$ k_0:=0\\ k_{i+1}:=\min\{k\in(k_i,n):f(x_k)\neq f(x_{k_j})\,\forall j\le i\}\,\,\text{provided it exists} $$ so tha tif $y_i=f(x_{k_i})$ then $$ f[X]=\{y_0,\dots,y_{m-1}\} $$ for some $m\le n$
So unfortunately I did not able to use the theorem $3.5$ to prove the theorem $2.5$ so that I thought to put a specific question where I ask to show how use it. So could anyone help me, please?