First, we show that $h$ is an injection. This is easy to do.
Let $y_1, y_2 \in Y$ with $y_1 \neq y_2$. Then, we have $g(y_1) \neq g(y_2)$. (Since $g$ is a bijection and in particular, an injection.)
WLOG, assume that the $g(y_1) < g(y_2)$. In this case, we have $\{1, \ldots, g(y_1)\} \subsetneq \{1, \ldots, g(y_2)\}.$ Moreover, $g(y_2) \in g(Y)$ and thus, $\{1, \ldots, g(y_1)\} \cap g(Y) \subsetneq \{1, \ldots, g(y_2)\} \cap g(Y).$
(Simply put: $g(y_2)$ is an element of $\{1, \ldots, g(y_2)\} \cap g(Y)$ but not $\{1, \ldots, g(y_1)\} \cap g(Y)$.)
This tells us that $h(y_1) < h(y_2)$ which proves injectivity of $h$.
Before showing the surjectivity of $h$, we note the following lemma:
Lemma. Given any $n \in \mathbb{N}$, $g(Y)$ has at least $n$ elements.
The proof should be fairly straightforward.
Now, we show the surjectivity of $h$. Let $n \in \mathbb{N}.$
Note that $g(Y)$ is a subset of $\mathbb{N}$ and hence, is well-ordered.
Let $k_n$ be the $n^{\text{th}}$ smallest element of $g(Y)$. Then, $k_n = g(y_n)$ for some (unique) $y_n \in Y$.
Then, verify that $h(y_n) = n.$ This conlcudes the proof.