Let $T$ be a linear operator on a vector space $V$, and let $W$ be a $T$-invariant subspace of $V$. Prove that $W$ is $g(T)$-invariant for any polynomial $g(t).$
is an answer that I found online. I wanted to know exactly how we use the fact that $W$ is a subspace of $V$? (as stated in the second to last line in the proof.)

$W$ is closed under addition. Hence, from the terms being in $W$, we can conclude that their sum is also in $W$. $W$ being a subspace here means that it is itself a vector space, which is closed under addition and scalar multiplication.