Let $f:X\rightarrow Y$ be non-surjective (not onto), and let $g:Y\rightarrow Z$ be non-injective (not $1-1$). Now, construct the composition $g\circ f$ such that it's a bijection.
My approach was this: Let $f$ be $x^2$, and let $g$ be $x^2$, thus $g\circ f$ is $x^4$, which has an inverse, namely $\sqrt[4]{x}$, and since invertability is necessary and sufficient for bijectivity, then the desired construction is complete.
Here is my second approach: Let $f$ be defined as $f(x)=\sqrt{x}$, where $f:\mathbb{R_{\geq 0}}\rightarrow \mathbb{R}$, and let $g$ be defined as $g(x)=x^2$, where $g:\mathbb{R}\rightarrow \mathbb{R_{\geq 0}}$, so $(g\circ f)(x)=x$, which clearly is invertible and therefore bijective, and thus the desired construction has been completed; quod erat demonstrandum. Right?
Assuming you have $\operatorname{f},\operatorname{g}: \mathbb{R} \to \mathbb{R}$, your example does not work.
You have $\operatorname{f}(x) = x^2$ and $\operatorname{g}(x) = x^2$. It follows that the composite function $\operatorname{g}\circ\operatorname{f}$ is given by $(\operatorname{g}\circ\operatorname{f})(x) = (x^2)^2 \equiv x^4$. This function is not bijective since $x^4 \ge 0$ for all $x$. A function must take all values, i.e. be surjective, in order to be bijective.
Note that $x \mapsto x^4$ is not injective. We have $(-1)^4 = 1$ and $(+1)^4 = 1$. Two values, $x = \pm1$ are sent to the same value. Furthermore, notice that invertibility is not equivalent to bijectivity. The function $\operatorname{h} : \mathbb{R} \to \mathbb{R}$ given by $\operatorname{h}(x) = \operatorname{e}^x$ is invertible, $\operatorname{h}^{-1}(x) = \ln x$, but it is not bijective. What value of $x$ gives $\operatorname{e}^x = -1$? It is not surjective and so not bijective. However, $\operatorname{h} : \mathbb{R} \to \mathbb{R}^+$ is bijective. Ivertibilty makes a function bijective onto its image.