Represent the linear transformation $T:\mathbb{R}^3\to\mathbb{R}^3$ by a $3\times 3$ matrix $A$.
Then the given condition becomes
$A^3-A^2-A+I=0$.
Now factor the polynomial expression:
$A^3-A^2-A+I=A^2(A-I)-I(A-I)$
$=(A^2-I)(A-I)$
$=(A-I)^2(A+I)=0$.
This factorization is useful, but from
$(A-I)^2(A+I)=0$ we cannot say that $A-I=0$ or $A^2-I=0$ separately.
So, we check the two claims directly.
First, let $Av=0$ for some vector $v$.
Then from
$A^3-A^2-A+I=0$,
we get
$(A^3-A^2-A+I)v=0$.
Since $Av=0$, it follows that
$0-0-0+v=0$,
so $v=0$.
Hence, $\ker(A)=\{0\}$.
Therefore, $A$ is one-one, and since $A$ is a linear map from $\mathbb{R}^3$ to $\mathbb{R}^3$, it must be invertible.
So, $T$ is necessarily invertible.
Now we check diagonalizability.
Since
$(A-I)^2(A+I)=0$,
the minimal polynomial of $A$ divides $(x-1)^2(x+1)$.
Because this polynomial has a repeated factor $(x-1)^2$, the matrix need not be diagonalizable.
A counterexample is
$A=\begin{pmatrix}
1&1&0\\
0&1&0\\
0&0&-1
\end{pmatrix}$.
This matrix is invertible, but it is not diagonalizable because the block $\begin{pmatrix}1&1\\0&1\end{pmatrix}$ is a Jordan block.
Also, this matrix satisfies
$(A-I)^2(A+I)=0$,
hence
$A^3-A^2-A+I=0$.
Therefore, $T$ is invertible, but not necessarily diagonalizable.
So, the correct option is $\boxed{\text{B}}$.