Let $f:(a,b)\rightarrow{\mathbb R}$ be a function. If $f(x)=g(x)^2$, then $f$ is non-negative and inherits the regularity of $g$. Conversely, let us assume that $f\ge0$ and $f\in{\mathcal C}^k$. What can be said about a square root $g$ ?
If $f$ is ${\mathcal C}^2$, then $f$ admits a ${\mathcal C}^1$ square root (T. Mandai, 1985). If $f$ is ${\mathcal C}^4$, then $f$ admits a twice differentiable square root $g$ (Alekseevskiĭ et al., 1988). However, $g$ might not be ${\mathcal C}^2$ (Bony et al., 2006).