:\begin{cases} u_{t}=ku_{xx} & (x, t) \in [0, \infty) \times (0, \infty) \\ u(x,0)=g(x) & IC \\ u(0,t)=0 & BC \end{cases}
What is the solution for $k$ as a function of $t$. I suspect it requires having to integrate $k(t)$ over the time to find the mean value
By an odd extension $g(x):=-g(-x)$ for $x<0$, you can solve the heat equation on the whole real line (which I assume you know how to do?). Then restrict this solution to the half line.