Is this set a subspace? Let $\mathbb{F}[X]$ be the vector space of all polynomials over the field $\mathbb{F}.$
I'm trying to determine whether the following set is a subspace:
$$W=\{p:p(0)=p(1)\}$$ where $p$ is a polynomial.
My working:
Let us write $p(x)=a_0+a_1x+a_2x^2\cdots+a_nx^n$.
Then $$ \begin{cases}p(0)=a_0 \\ p(1)=a_0+a_1+a_2+\cdots +a_n \end{cases} $$
Now, $P(0)=p(1) \iff a_0=a_0+a_1+\cdots+a_n \iff a_1+a_2+\cdots +a_n=0$.
Therefore, we can write $W$ as $$W=\left\{a_0+a_1x+\cdots+a_nx^n:a_1+a_2+\cdots+a_n=0\right\}.$$
Note that this is independent of $a_0.$ Now, the question is: is $W$ closed under addition and scalar multiplication?
Let $$b=b_0+b_1x+\cdots+b_nx^n \in W$$ and let $$c=c_0+c_1x+\cdots+c_nx^n \in W \quad .$$
Then (as we've just shown):
$$\begin{cases} b_1+b_2+\cdots+b_n=0 \\ c_1+c_2+\cdots+c_n=0\end{cases} \quad .$$
Now,  $b+c=(b_0+b_1x+\cdots+b_nx^n)+(c_0+c_1x+\cdots+c_nx^n)$.
Is this right so far? What should I do now?

Although the methodology of proof that you are using works in spirit, it is overcomplicating the central details that the sum of two functions $f$ and $g$ that take values in $\mathbb{F}$ be defined by $$(f+g)(x)=f(x)+g(x),$$ and similarly that the scalar multiple of $f$ by $\lambda\in \mathbb{F}$ be defined by $$(\lambda f)(x)=\lambda f(x).$$
From this it follows that if $p,q\in W$, and thus $p(0)=p(1)$ and $q(0)=q(1)$, we have
$$(p+q)(0)=p(0)+q(0)=p(1)+q(1)=(p+q)(1) \quad \text{and} \quad (\lambda p)(0)=\lambda p(0)=\lambda p(1)=(\lambda p)(1).$$
More generally, given any linear subspace $Y$ of the function space $$\mathcal{F}(X,\mathbb{F})= \{f \mid \text{$f$ is a function $f:X\rightarrow \mathbb{F}$}\}$$
and two (not necessarily distinct) values $a,b\in X$, the set
$$W=\{f \in \mathcal{F}(X,\mathbb{F}) \mid f(a)=f(b)\}$$
defines a linear subspace of $Y$ by the same argument as above.
