Examples to keep in mind for questions like this:
Take $X = \{1\}$, $Y = \{a,b\}$, $Z =\{\bullet\}$. Let $f\colon X\to Y$ be given by $f(1)=a$, and $g\colon Y\to Z$ given by $g(a)=g(b)=\bullet$.
Then $g\circ f\colon X\to Z$ is bijective; note that $f$ is injective but not surjective, and that $g$ is surjective but not injective. So, injectivity of the composite function cannot tell you anything about injectivity of the last function applied; and surjectivity of the composite function cannot tell you anything about surjectivity of the first function applied.
As above, but now take $Y = \{a,b\}$, $Z=\{\bullet\}$, and $W=\{1,2\}$. Let $g\colon Y\to Z$ be given by $g(a)=g(b) = \bullet$, and $h\colon Z\to W$ be given by $h(\bullet) = 1$. Then $h\circ g\colon Y\to W$ maps both $a$ and $b$ to $1$. Note that $g$ is surjective, $h$ is injective, but $h\circ g$ is neither. So: surjective followed by injective could be neither.
Playing around with similar examples will show you that injective followed by surjective may also be neither. For instance, modify the first example above a bit, say $Y = \{a,b,c\}$, $Z = \{\bullet,\dagger\}$, $f\colon X\to Y$ given by $f(1)=a$, $f(2)=b$ (injective), and $g\colon Y\to Z$ given by $g(a)=g(b)=\bullet$, $g(c)=\dagger$ (surjective). Is $g\circ f$ injective? Is it surjective?