Substitution rule relies on chain rule and the chain rule requires both f and g to be differentiable.
In showing \displaystyle \int f(x)dx=\displaystyle \int f(g(t))g'(t)dt,
All we require in substitution rule is that $f(x)$ be continuous so that its antiderivative exists-and is differentiable, say $F$ and $g(x)$ to have a continuous derivative, so the composition $F \circ g$ is differentiable, which we differentiate using chain rule.
So, by chain rule, \displaystyle\frac{d}{dt}(F \circ g)(t)=f(g(t))g'(t). By fundamental theorem of calculus,
\displaystyle \int_a^b f(g(t))g'(t)dt=(F \circ g)(b)-(F \circ g)(a)=\displaystyle \int_{g(a)}^{g(b)}f(x)dx. Thus we have proved substitution rule.
Since we don't need to differentiate $f \circ g$ to prove substitution rule, we don't require $f$ to be differentiable.