In general, it's possible for a composition to be invertible and neither function to be invertible: take $f\colon\{a\}\to\{1,2\}$ given by $f(a)=1$, and $g\colon\{1,2\}\to\{x\}$ given by $g(1)=g(2)=x$. Neither $f$ nor $g$ are invertible ($f$ is not onto, $g$ is not one-to-one) but $gf\colon\{a\}\to\{x\}$ is clearly invertible.
What is true is that if $f$ and $g$ are invertible and you can compose them, then $gf$ is invertible and $(gf)^{-1} = f^{-1}g^{-1}$. But you cannot conclude that $f$ and $g$ are each invertible from the assumption that $gf$ is invertible.
For a linear example, take $T\colon\mathbb{R}^2\to\mathbb{R}^3$ given by $T(x,y) = (x,y,x-y)$ (not onto), and $S\colon\mathbb{R}^3\to\mathbb{R}^2$ given by $S(x,y,z) = (x,y)$ (not one-to-one). Neither $T$ nor $S$ are invertible, but $ST\colon\mathbb{R}^2\to\mathbb{R}^2$ is invertible.
For a linear example with maps from the a vector space to itself, necessarily infinite dimensional in view of the theorem above, take the vector space of all sequences of real numbers, and let $T$ be the "right shift" operator and $S$ the "left shift" operator. that is, $T(a_1,a_2,a_3,\ldots) = (0,a_1,a_2,\ldots)$, and $S(a_1,a_2,a_3,\ldots) = (a_2,a_3,\ldots)$. Check that neither $T$ nor $S$ are invertible, but that $ST$ is the identity map, hence invertible.
So: first assume that $ST$ is invertible. Use this to show that $T$ must be one-to-one.
Added hint: To show that $T$ is one-to-one, you want to show that if $\mathbf{v}\in V$ is such that $T(\mathbf{v})=\mathbf{0}$, then $\mathbf{v}=\mathbf{0}$ (that is, the only vector that goes to $\mathbf{0}$ is the zero vector; we're showing the nullspace of $T$ is trivial, or that the nullity is $0$). So, let $\mathbf{v}$ be a vector in $V$ such that $T(\mathbf{v})=\mathbf{0}$. What is $ST(\mathbf{v})$? What does that tell you about $\mathbf{v}$? What does that tell you about $T$ (and why)?
Once you know that $T$ is one-to-one, then you can use the Rank-Nullity Theorem to conclude that since $T$ is one-to-one and maps from $V$ to itself ($V$ finite dimensional), then $T$ is invertible. And then you can use that both $ST$ and $T$ are invertible (and hence both $ST$ and $T^{-1}$ are invertible) to show that $S$ is invertible. And if both $S$ and $T$ are invertible, then show that $TS$ is invertible. This proves that if $ST$ is invertible, then $TS$ is invertible; the converse follows by simply swapping the roles of $S$ and $T$.
A first thing to realise is that the image of $T^2$ is always contained in the image of $T$, since any vector of the form $T(T(v))$ is in particular of the form $T(w)$. Then the given fact that $T$ and $T^2$ have the same rank means that they actually have the same image; call this common image$~W$.
Now the restriction of $T$ to its own image $W$ defines a linear map $\tilde T:W\to W$ (one might call it $T|_W$, but note that both domain and codomain have changed). And the image of $\tilde T$ is by definition the image of $T^2$, which is all of$~W$, so $\tilde T$ is surjective. Then the kernel of $\tilde T$ is $\{0\}$, and by definition this kernel is the intersection of the kernel of$~T$ with its image$~W$.
Best Answer
Since ${\cal R} T^2 \subset {\cal R} T$ and $\operatorname{rk} T^2 = \operatorname{rk} T$, we have ${\cal R} T^2 = {\cal R} T$.
Hence the rank nullity theorem gives $\dim \ker T^2 = \dim \ker T$, and since $\ker T \subset \ker T^2$, we have $\ker T =\ker T^2$.
Now suppose $x \in {\cal R}T \cap \ker T$, then there is some $y$ such that $x=Ty$ and $Tx = 0$. Hence $T^2 y = 0$ and so $Ty = 0$ and so $x = 0$. Hence ${\cal R}T \cap \ker T = \{0\}$.
Note that this works for finite dimensional spaces. Here is an example for an infinite dimensional space.
If you look at the linear operator $T(x_1,x_2,...) = (x_2,x_3,...)$ on the space of sequences, we see that ${\cal R} T^2 = {\cal R} T$, but with $x = (1,0,0,...)$ we have $x = T(0,1,0,0,...)$ and $T x = 0$, hence ${\cal R}T \cap \ker T \neq \{0\}$.