First of all I think that the title is a little misleading. In fact the theorem does not say that $T$ is surjective iff exists the inverse, it says instead iff exists the right inverse. I'll make an example. If you have a linear application $F:\mathbb R^3\rightarrow\mathbb R^2$ such that $F(x,y,z)=(x,y)$ you have for sure a surjective application but you won't find it's inverse. In fact that is valid only if the two spaces have the same (finite) dimension (that was just in case you didn't know, if you wrote that title in order to simplify it I'm sorry). That said, let's demonstrate the $(\Leftarrow)$ part: take $x \in W$ then we have that $S(x)=y \in V$, so $T(y)=T(S(x))=I_W(x)=x$.
Now the $(\Rightarrow)$ part $: \forall y \in W, \exists x \in V: T(x)=y $. Now I define $S:W \rightarrow V$ such that $S(y)=x$, if I take $y \in W, \rightarrow T(S(y))=T(x)=y \Rightarrow T \circ S=I_w$ (note that $S$ is linear). Hope it helps.