Let $X$ be a set and $G$ a group with the operation $\star$. Show that the set $$ \mathcal{X} = \Big\{ \varphi : X\to G \mid \text{$\varphi$ is a function} \Big\} $$ is a group with the operation \begin{equation}\label{star} \big(\varphi \star \psi\big)(a) \; = \; \varphi(a) \star \psi(a) \qquad \quad \forall\,a\in G. \end{equation}
So associative is pretty easy since $(G,\star)$ is a group: Let $\varphi,\tau,\phi\in\mathcal{X}$. Thus, \begin{align*} ((\varphi\star\tau)\star\phi)(g) &= (\varphi\star\tau)(g)\star\phi(g)\\ &= (\varphi(g)\star\tau(g))\star\phi(g)\\ &=\varphi(g)\star (\tau(g)\star\phi(g))&G \text{ group}\\ &= \varphi(g)\star(\tau\star\phi)(g)\\ &= (\varphi\star(\tau\star\phi))(g) \end{align*} And for identity, let $id:G\to G$ with the map $g\mapsto e$, with $e$ the identity on G, is a function and acts as an identity for $\mathcal{X}$: $$(\varphi\star id)(g) = \varphi(g)\star id(g) = \varphi(g)\star e = \varphi(g) = e\star \varphi(g) = id(g)\star\varphi(g) = (id\star\varphi)(g).$$
But I'm having trouble proving closure and inverses. Since we don't know if an element is bijective or not, then we can't construct an inverse. And for closure, how can I show that $\varphi(a) \star \psi(a)$ is still a function?