Let $T: V \to V$ a linear map, with $\dim V < \infty$. Let $v \in V$ such that $T^{k-1}v \neq 0$ and $T^k v = 0$ for some $k \geq 1$.
(a) Prove that $S = \{v, Tv,...,T^{k-1}v\}$ is linearly independent.
Since $T^kv = 0$, then $T^{k+n}v = T^{n}(T^{k}v) = T^{n}0 = 0$ for all $n \geq 1$. Suppose that $$c_0 v + c_1 Tv + \cdots + c_{k-1}T^{k-1}v = 0.$$
Apply $T^{k-1}$ in both sides. Thus we have $c_0 T^{k-1}v = 0$ and so, $c_0 = 0$. Now apply $T^{k-2}$ for get $c_1 = 0$. Using the same argument for the others $c_i$, we conclude that $c_0 = \cdots = c_{k-1} = 0$. Therefore, $S$ is linearly independent.
(b) Prove that $W = Span(S)$ is invariant.
Note that $T(S) = \{Tv, T^2v,...,T^kv\} = \{Tv,...,T^{k-1}v,0\}$, $T(S)$ and $S$ generates the same space. Since for every $w \in W$, $w$ is a linear combination of elements in $S$, $Tw$ is a combination of elements in $T(S)$ and from the previous observation, $W$ is invariant.
(c) Prove that $T$ restrict to $W$ is well-defined and is nilpotent of order $k$.
Applying $T$ in $S$ is clear that $T$ is nilpotent of order $k$. Why is necessary to prove that $T$ is well-defined? I cannot see why.
(d) Write the matrix associate to restriction $T|_W$ in the basis $S$.
We have that
$$Tv = 0v + 1Tv + 0T^2v + \cdots + 0T^{k-1}v = (0,1,0,...,0)$$ $$T(Tv) = (0,0,1,0,...,0)$$
Repeating the calculations
$$\left(\begin{array}{ccccc} 0 & 0 & \cdots & 0 & 0\\ 1 & 0 & \cdots & 0 & 0\\ 0 & 1 & \ddots & \vdots & \vdots \\ \vdots & \vdots & 1 & 0 & 0\\ 0 & 0 &\cdots & 1 & 0 \end{array}\right)$$
Is there some mistake? Also, can someone help me with the question in the item (c)?
(a) Correct.
(b) Careful: $T(S)$ and $S$ don't generate the same space; you mean something different. (I suspect you have just misstated your claim.)
(c) This is worded somewhat ambiguously. The restriction of $T$ to $W$ is always well-defined as a map from $W$ to $V$, but the author clearly wants to say that it is well-defined as a map from $W$ to $W$ (because for a map from $W$ to $V$, it makes no sense to speak of nilpotence).
(d) Correct, except for your use of equality signs for "corresponds to ... in the basis". (The vector $Tv$ is not literally equal to the row vector $\left(0,1,0,0,\ldots,0\right)$; it just corresponds to the latter when expanded in the basis $S$.)