edited
Recently I'm trying to prove that given a finite set $X$, a function $f: X\longrightarrow X$ is injective if and only if it is surjective. And as part of that proof I came to the conclusion that I must prove the following:
$g: I_n\longrightarrow I_n$ is injective if and only if it is surjective.
To do this I will use a lemma and a theorem that I have already proved previously
Lemma 1. If $f: X \longrightarrow Y$ is an injective function, then $f: X \longrightarrow f(X)$ is a bijection.
Theorem 1. Let $A\subset I_n$. If there exists a bijection $f: A \longrightarrow I_n$, then $A=I_n$.
I will proceed to show my progress of the demonstration of the above in quotation marks.
If $g$ is injective, then by Lemma 1, $g: I_n \longrightarrow g(I_n)$ is a bijection, then it has an inverse function $g^{-1}: g(I_n) \longrightarrow I_n$ which will also be a bijection, also $g(I_n) \subset I_n$ and by Theorem 1 it is concluded that $g(I_n)=I_n$, that is, $g$ is surjective.
If $g$ is surjective, then it has a right inverse, let $h:I_n \longrightarrow I_n$ be the right inverse of $g$, that is, $g(h(w))=w$ for all $w\in I_n$. Furthermore note that $h$ is injective, since considering $w_1$, $w_2\in I_n$ such that $h(w_1)=h(w_2)$, then $w_1=g(h(w_1))=g(h(w_2))=w_2$. Then we have that $h: I_n \longrightarrow I_n$ is injective, and from what has been demonstrated above, it implies that $h$ is surjective. Now, let $x_1$,$x_2\in I_n$ such that $g(x_1)=g(x_2)$. Then there will exist $y_1$,$y_2\in I_n$ such $h(y_1)=x_1$ and $h(y_2)=x_2$, so we have that $$y_1=g(h(y_1))=g(x_1)=g(x_2)=g(h(y_2))=y_2$$ finally, since $y_1=y_2$, then $x_1=h(y_1)=h(y_2)=x_2$. It is concluded that $g$ is injective.
I just edited my demo, found a way around the complications. Any comments or is the demonstration correct? Thank you very much for the answers.