Almost certainly, your textbook is refering to the set of all polynomials of degree at most $n$, rather than the polynomials of degree exactly $n$. The latter is indeed not a vector space under the usual addition of polynomials: it doesn't contain the $0$ polynomial (which either has no degree, or has some degree smaller than $0$), and it's not closed under sums: both $x^n+x^{n-1}$ and $-x^n$ are polynomials of degree $n$, but their sum is not.
So I suspect your textbook is asking for the vector space that consists of all polynomials of degree at most $3$, which further satisfy $f(1)=0$ and $\int_{-1}^1 f(t)\,dt = 0$. That is, if we let $\mathbf{P}_3$ denote the vector space of polynomials of degree at most $3$, then it wants you to find a basis for $\mathbf{W}$, where $\mathbf{W} = \left\{ f(t)\in\mathbf{P}_3\;\left|\; f(1)=0\text{ and }\int_{-1}^1f(t)\,dt = 0\right.\right\}.$
You say you want to solve this via a matrix; well: the map $\mathbf{P}_3\to\mathbb{R}$ given by "evaluation at $1$" ($p(t)\longmapsto p(1)$) is a linear transformation. And the map $\mathbf{P}_3\to\mathbb{R}$ given by "integrate over $[-1,1]$ ($p(t)\longmapsto \int_{-1}^1p(t)\,dt$) is also a linear transformation. Call the first linear transformation $E$ and the second $T$. The polynomials that are in the nullspace/kernel of the first map are precisely the ones that satisfy $f(1) = 0$. The ones that are in the kernel of the second one are precisely the ones that satisfy $\int_{-1}^1f(t)\,dt = 0$. You want the ones that are in the kernel of both.
The standard way of achieving this is to map to the product: take the map $L\colon\mathbf{P_3}\to \mathbb{R}\times\mathbb{R}=\mathbb{R}^2$, given by: $L(p(t)) = \Bigl( E(p),\; T(p)\Bigr) = \left(p(1),\quad\int_{-1}^1p(t)\,dt\right).$ Then the subspace you want is precisely the kernel of $L$.
To find the kernel of $L$, one possibility is to pick a basis for $\mathbf{P}_3$ (say, the standard basis $[1,t,t^2,t^3]$), a basis for $\mathbb{R}^2$ (say, the standard basis $[(1,0), (0,1)]$), construct the matrix representation for $L$, and find the nullspace of that matrix. Interpreting this nullspace in terms of the basis $[1,t,t^2,t^3]$ will give you the kernel you want, and finding a basis for that nullspace will yield a basis for the subspace of $\mathbf{P}_3$ that you are looking at.