Let $\Omega \subseteq \mathbb{R}^n$ be an open bounded domain, and let $1<p<n$. Suppose that $f \in W^{1,p}(\Omega)$ is continuous*, and $g \in C^{\infty}(\mathbb{R})$.
Is it true that $g \circ f \in W^{1,p}_{loc}(\Omega)$?
My guess was that the answer is positive, and that $\partial_i (g \circ f)(x)=g'(f(x)) \partial_i f(x)$ but a naive calculation to prove it failed.
*Note that the continuity of $f$ does not follow from $f \in W^{1,p}(\Omega)$, since $p<n$; this is an additional assumption I am adding.