Homework: determining if a space is a subspace This question is from an assignment I'm working on:

Which of the following are subspaces of ${\bf F}~[-1,1]=\{~f~|~f:[-1,1]\rightarrow\mathbb{R}\}$?
$X=\{~f\in{\bf F}[-1,1]~|~f(-1)=f(1)\}$
$Y=\{~f\in{\bf F}[-1,1]~|~f(0)=-1\}$
$Z=\{~f\in{\bf F}[-1,1]~|~f(x)=f(y)~\forall~x,y\in[-1,1]\}$
$W=\{~f\in{\bf F}[-1,1]~|~f(-1)\le 0\}$

So far, I've found that:

*

*X cannot be a subspace of ${\bf F}$ as it is outside of the domain of ${\bf F}$ when $x>-1$


*Y cannot be a subspace of ${\bf F}$ either, as $f(x<0)$ is outside the domain of ${\bf F}$ as well


*I'm entirely unsure whether Z is a subspace of ${\bf F}$, and I'm not even sure how to evaluate Z.


*I think that W is not a subspace of ${\bf F}$, as it is outside the domain of ${\bf F}$ for $x>0$, although I'm hesitant to put this down as a justification.
This being said, I'm fairly new to linear algebra, and those answers could be wrong.
My biggest issue is with W, since I have no idea where to start.
Any suggestions on how W can be evaluated, and feedback on the answers I've already found?
 A: $F=\left\{f\mid f:[-1,1]\to\Bbb R\right\}$

For a set $S$ to be a subspace of $F$, you need:


*

*$S\subseteq F$

*$\forall f,g \in S, f + g \in S$

*$\forall f \in S,\forall \lambda \in \Bbb R, \lambda f \in S$

Since all your sets are written as $\left\{f\in F \mid \dots\right\}$, it is obvious that they are all subsets of $F$ so we only need to check the two other requirements.

$X=\left\{f\in F \mid f(-1)=f(1)\right\}$


*

*Let $f,g \in X$.
$(f+g)(-1)=f(-1)+g(-1)=f(1)+g(1)=(f+g)(1)$ so $f+g\in X$

*Let $f\in X$ and $\lambda \in \Bbb R$. $(\lambda f)(-1)=\lambda(f(-1))=\lambda(f(1))=(\lambda f)(1)$ so $\lambda f \in X$
So $X$ is a subspace of $F$.

$Y=\left\{f\in F \mid f(0)=-1\right\}$


*

*Let $f,g \in X$.
$(f+g)(0)=f(0)+g(0)=(-1) +(-1)=-2\not = 0$ so $f+g\not\in X$


That's how you would see that it doesn't work but you don't need a result that strong. You only need one counterexample.
For example take $f=g=x\mapsto -1$. It is easy to see that $f=g\in Y$ but $f+g\not\in Y$ so $Y$ is not a subspace.

$Z=\left\{f\in F \mid \forall x, y \in [-1,1],f(x)=f(y)\right\}$


*

*Let $f,g \in Z$.
$\forall x,y \in [-1,1],(f+g)(x)=f(x)+g(x)=f(y)+g(y)=(f+g)(y)$ so $f+g\in Z$

*Let $f\in Z$ and $\lambda \in \Bbb R$. $\forall x,y \in [-1,1], (\lambda f)(x)=\lambda(f(x))=\lambda(f(y))=(\lambda f)(y)$ so $\lambda f \in Z$
So $Z$ is a subspace of $F$.

Do you see why $X$ is a subspace? $x>-1$ isn't out of the domain (as long as $x\le 1$): the domain still is $[-1,1]$. The $f(-1)=f(1)$ is just an additionnal condition.
Anyway, try to find the answer for the two last onces like I did: Take elements and show combinaisons are inside or, if you get blocked at some point, try to find a counterexample.

As Geoff Pointer pointed out in the comments, you also need $0\in S$ for $S$ to be a subspace. It is trivial both all sets except $Y$ where it fails. So just saying $0\not\in Y$ would be enough to prove it's not a subspace.
