I was given that $X$ is finite if any function that maps $X$ to $X$ is surjective and injective. Also, the problem specifies the finite set $N$ as a set with $n$ elements.
Now, I only know that there exists one function that is surjective and injective from $X$ to $X$: Define $X_1=X_2$ and $f: X_1\to N$ and $g: X_2\to N$. Since the composition of two surjective function is surjective, $f-1(g(X_1))$ is surjective. Thus, there is one function from $X$ to $X$ that is both injective and surjective.
But how can I prove that for every function from $X$ to $X$ itself is both injective and surjective?
Can anyone help me with this problem? Any help would be appreciated. Thanks