Separation of Variables (PDEs): What about $0$? 
Question: [See the context given below.]
$\rm\color{#c00}{(a)}$ When we divide by the functions $T$ and $X$ to obtain $(1)$, aren't we assuming that the functions will be non-vanishing on their whole domain (otherwise it doesn't make sense)?
$\rm\color{#c00}{(b)} $I know that when we solve the separable ODE
  $$
y'=f(x)g(y),
$$
  by dividing by $g(y)$, relatively general conditions on $g$ (continuity is not enough) will assure that either $g(y)\equiv0$ or $g(y)\neq0$ on the whole domain.
But here, for example, $X_4$ given by $(2)$ is $0$ at $x=\frac{L}{2}$. So, there is no analogous comforting result?
$\rm\color{#c00}{(c)}$ Is there some kind of "continuous extension" of the solutions on $(0,\frac{L}{2})$ and $(\frac{L}{2},L)$? What when $n$ is general?
One can always verify that the final solution obtained by the applying the method is, indeed, a solution. But, I'm interested in understanding why the method works.

Context: Suppose you want to solve the following homogeneous heat equation problem:
$$
\begin{cases}
u_t-ku_{xx}=0\quad(0<x<L,t>0),\\
u(0,t)=u(L,t)=0\quad(t\geq0),\\
u(x,0)=f(x)\quad(0\leq x\leq L)
\end{cases}
$$
with the compatibility condition $f(0)=f(L)=0$ satisfied.
Proceeding by separation of variables, writing $u(x,t)=X(x)T(t)$, the usual argument is that one is led to
$$
\frac{T_t}{kT}=\frac{X_{xx}}{X}\tag{1},
$$
which must be satisfied for all admissible couple $(x,t)$, so that the LHS and the RHS must be constant. One is then led to Sturm-Liouville problems and one can show that the eigenvalue-eigenvector couples for the resulting problem in $X$ are
$$
(\lambda_n,X_n):=\left(\frac{n^2\pi^2}{L2},\sin\left(\frac{n\pi x}{L}\right)\right)\quad(n\geq1)\tag{2}.
$$
 A: Back up one step from $(1)$, to $u(x,t)=X(x)T(t)$ and the PDE implies $$XT'=kX''T.\tag{0}$$ Now, when you divide through by $kX(x)T(t)$ in $(0)$, we are making the implicit assumption that we are not doing so when $X(x)=0$ or $T(t)=0$. The only way this is impossible is if $X(x)\equiv 0$ or $T(t)\equiv 0$ but either of those in turn cause $u(x,t)\equiv 0$ and such a $u$ won't satisfy any interesting initial conditions. In other words, at the outset, we declare that we are looking for nontrivial (not identically zero) solutions.
Now, even under that assumption, how is it valid to go from $(0)$ to $(1)$? Well, it must mean that we are performing that division for values of $x$ for which $X(x)\not=0$ and values of $t$ for which $T(t)\not=0$. That is,
$${X''(x)\over X(x)}={T'(t)\over k T(t)}=-\lambda, \qquad \forall x,t\text{ such that }X(t)\not=0,\ T(t)\not=0.\tag{2}$$
Proceeding from there, you find the solution to the IBVP subject to the $x$, $t$ condition in $(2)$. 
But what about $Z:=\{(x,t):X(x)=0\text{ or }T(t)=0\}$? Suppose $X(x^*)=0$, i.e. $(x^*,t)\in Z$, where the zero occurs in $X$ rather than $T$. Then $u(x^*,t)=X(x^*)T(t)$ and since we are assuming a solution of the form $u(x,t)=X(x)T(t)$, then 
\begin{align}
0&=u_t(x^*,t)-ku_{xx}(x^*,t)\\
0&=X(x^*)T(t)-kX''(x^*)T(t)\\
0&=0\cdot T(t)-kX''(x^*)T(t)\\
0&=X''(x^*)T(t)
\end{align}
so either $X''(x^*)=0$ or $T(t)=0$ for all $t$. Either way, $(0)$ holds at that $(x^*,t)\in Z$. A similar argument shows $(0)$ is also satisfied for $(x,t^*)\in Z$. So 
we know what the solution is on $Z$. The rest of the work in the separation of variables method is to find $u(x,t)$ for $(x,t)\not\in Z$.
So in your sample problem we end up with the sequence of eigenvalues and eigenfunctions $$\lambda_n=\left({n\pi\over L}\right)^2, \qquad X_n(x)=\sin(n\pi x/L), \qquad n=1,2,\dots$$
Since $T_n(t)=Ce^{-\lambda_n k t}$, the $T_n(t)$ never vanish (and thus make no contribution to the set $Z$), but the number of zeros of $X_n(x)$ increases with $n$. 
For example, 
$$
n=2,\ L=1,\ x={1\over 2}\implies X_2(1/2)=\sin((2\pi\cdot {1\over 2})/1)=\sin(\pi)=0.
$$
Is this problematic? Well, let's finish the process. Recall that in light of having found these sequences $X_n(x)$, $T_n(t)$, $n=1,2,\dots$, what we have found is a solution $$u_n(x,t)=X_n(x)T_n(t) \text{ for each fixed }n=1,2,\dots$$ 
Then we superimpose to find the solution
$$
u(x,t)=\sum_{n=1}^\infty b_nX_n(x)T_n(t)=\sum_{n=1}^\infty b_n \sin(n\pi x/L)e^{-\lambda_n k t}.
$$
Indeed,
$$u_2(1/2,t)=X_2(1/2)T_2(t)=0,$$ 
but that doesn't make $u(1/2,t)$ vanish since not all the $X_n(x)$ vanish at $x=1/2$.
To summarize: for each fixed $n=1,2,\dots$ there is a set 
$$
Z_n:=\{(x,t): 0<x<L\text{ and } t>0;\ X_n(x)=0\text{ or }T_n(t)=0\}.
$$
For each fixed $n$, on $Z_{n}$, $u_{n}(x,t)$ vanishes from $(0)$, without appealing to $(1)$. However, this does not mean $u(x,t)$ vanishes since $u_m(x,t)$, $m\not={n}$ don't all vanish. As for the $(x,t)\not\in Z_n$ (but in our domain), it is precisely for those $(x,t)$ pairs that we apply $(2)$.
Now you can see why we needed $X(t)$ and $T(t)$ not identically zero: it leaves room for us to implement the plan in the last paragraph.
A: While dividing by $X(x)T(t)$ is a quick and easy heuristic way to arrive at the desired ODEs for $x\mapsto X(x)$ and $t\mapsto T(t)$ one can do without division whatsoever.
In the case of the heat equation $u_t-k u_{xx}=0$ we hope that there are some solutions of the form $$u:\quad{\mathbb R}\times{\mathbb R}\to{\mathbb R},\qquad(x,t)\mapsto u(x,t)=X(x)T(t)\ .\tag{1}$$
This "Ansatz" immediately leads to the condition
$$X(x)\dot T(t)-k X''(x)T(t)=0\quad\forall x\>,\ \forall t\ .\tag{2}$$
A usable such solution will have a point $x_0\in{\mathbb R}$ with $X(x_0)\ne0$. Putting $x:=x_0$ in $(2)$ we see that the function $t\mapsto T(t)$ then would have to satisfy the constant coefficient ODE
$$\dot T(t)-{kX''(x_0)\over X(x_0)}\>T(t)=0\qquad\forall t\ ,$$
or $\dot T-\lambda T=0$, with a certain  (real or complex) constant $\lambda$, but no a priori condition on the value of this $\lambda$. The general solution of the latter ODE is $T(t)=Ce^{\lambda t}$, which then can be entered into $(2)$. This leads to the simpler condition 
$$\lambda X(x)-k X''(x)=0\qquad\forall x\tag{3}$$
involving only the function $x\mapsto X(x)$. The ODE $(3)$ has a two-dimensional solution space of functions $x\mapsto X(x)$, whereby the concrete expression of these solutions depends on the value of $\lambda$. One then has to confront the resulting expressions with the boundary conditions, and it turns out that for certain "special" values of $\lambda$ usable solutions $x\mapsto X_\lambda(x)$ result. Etcetera.
