Let $X$ be a finite set and let $f:X\rightarrow X$ be injective. Prove that $f$ is also surjective.
Here's my atempt:
Since $X$ is finite, there exists $g: I_n \rightarrow X$ bijective (Notation: $I_n = \{x\in N ; 1\leq x \leq n\}$). Since $f$ is injective, it follows that $f'=X \rightarrow f(X)$ is a bijective function. Noticing that $f(X)\subset X$, and that X is finite, it is also true that $f(X)$ is finite. By injectivity, we have that $h: I_n \rightarrow f(X)$ is also bijective. Let $\varphi$ be the following composition:
$\varphi = f'^{-1}\circ h \circ g^{-1} : X \rightarrow X$.
Since $f',g,h$ are all bijections, it follows that $\varphi$ is also bijective.
Now here come's my doubt: How do I guarantee/prove that $f$ and $\varphi$ are equal? Because if i prove that it's proven that $f$ is bijection.