Function spaces for the 1-dim heat equation. Consider the standard 1-dim heat equation:
$u_t(x,t)-\alpha u_{xx}(x,t)=0$, 
where $u:\mathbb{R}\times\mathbb{R_+}\rightarrow \mathbb{R}$, 
with initial conditions $u(x,0)=g(x), x\in\mathbb{R}$ and $\lim_{x\rightarrow\pm\infty}u(x,t)=0$.
One usually reads in the literature that $u$ and $g$ are "well-behaved" functions...
But, entering in detail, what are the natural spaces for $u(x,t)$ and $g(x)$?
I believe one usually considers $u\in C^2\cap L^2$ and $g\in L^2$, where $C^2$ is continuously 2-differentiable and $L^2$ is square-integrable. 
Is this correct ? Can we generalize or specialize to other spaces ?
If so, how does the solutions differ? (good links in the literature are welcome).
 A: 
what are the natural spaces

Depends on the task at hand. Function spaces are tools: a hammer is a natural tool for one task, a screwdriver for another. 

I believe one usually considers $u\in C^2\cap L^2$ and $g\in L^2$

I would not call this usual. The heat equation is of first order in $t$; why ask for two derivatives with respect to $t$?  And though we want to restrict the growth at infinity, assuming  $g\in L^2$ goes too far. It throws out the constant temperature solution $u\equiv 1$  with initial condition $g\equiv 1$. I'd want to keep those. 
Here is what Evans requires in his Partial Differential Equations book: 


*

*$u$ is $C^2$ with respect to $x$, for each $t>0$

*$u$ is $C^1$ with respect to $t$, for each $x$.

*$u$ is jointly continuous on $\mathbb R\times [0,\infty)$

*$g$ is continuous on $\mathbb R$ 

*$|g(x)|\le A\exp(a|x|^2)$  for some constants $a,A>0$

*$|u(x,t)|\le A\exp(a|x|^2)$ 


Under assumptions 1-6, Evans shows the existence and uniqueness of a solution. The growth condition 5-6 rules out non-physical solutions that would violate the uniqueness of the Cauchy problem.
