This question comes from the assertion that a trivial subspace consisting only of element zero {0}, will be an invariant subspace for all A.
This means: A.0 = 0 for any A so that the invariance holds true.
Does this have to necessarily hold true for any operator A to be linear?
Yes! This will always be true for a linear operator $A$. To see this:
$A(0) = A(0+0) = A(0)+A(0) = 2A(0)$, and the only way this can happen is if $A(0)=0$.