Consider the vector space $V=C(\mathbb{R},\mathbb{R})$ and $V\ni U=\{f\in C(\mathbb{R},\mathbb{R}) |f(0)=0\}$. I want to find a complement of $U$, such that $V=U\oplus W$. This condition is the same as finding a set $W$ that satisfies $V=U+W$ and $U\cap W={f_0}$ where $f_0$ is the null element. At a lecture, the professor defined $W=Span({\mathbb{\mathbf{1}}})$, where $\mathbf{1}$ is the function defined by $\mathbf{1}(x)=1\ \forall x\in \mathbb{R}$ and proved that this is a complement. He did not, however, give an explanation of how intuitively to find this complement without knowing beforehand that it indeed does satisfy the conditions.
Looking at the definition of $U$, I would rather define $W$ as: $$ W=\{f \in C(\mathbb{R}, \mathbb{R}): f(0) \neq 0\} \cup\left\{f_{0}\right\} $$ But I would imagine that if it were that simple, the professor would have done the same. Is there something wrong with my definition?
The issue is that the condition $V=U\oplus W$ requires $V$ and $W$ to be vector subspaces, as oposed to just sets as you say; in particular they have to be closed under vector addition. Having this in mind, if you define $$W=\{f \in C(\mathbb{R}, \mathbb{R}): f(0) \neq 0\} \cup\left\{f_{0}\right\},$$ then it's clear that this is not a vector space. To see this consider $f(x) = x^2+1$ and $g(x) = -1$ for all $x \in \mathbb R$; then $f,g \in W$, and if $W$ were indeed a vector space one would have $f + g \in W$, yet $$(f+g)(x) = (x^2+1)+ (-1)=x^2,$$ which is not in $W$.