How does energy conservation follow from Newton's second law?
Writing
$m \ddot x = -\dfrac{dV(x)}{dx}, \tag{1}$
we have
$m \ddot x + \dfrac{dV(x)}{dx} = 0; \tag{2}$
multiplying by $\dot x$ yields
$m \ddot x \dot x + \dfrac{dV(x)}{dx} \dot x = 0, \tag{3}$
which, using the chain rule may be re-written as
$\dfrac{1}{2} \dfrac{d(m\dot x^2)}{dt} + \dfrac{dV(x)}{dt} = 0, \tag{4}$
or
$\dfrac{d}{dt}(\dfrac{1}{2}( m \dot x^2) + V(x)) = 0. \tag{5}$
Now integrating both sides with respect to $t$ reveals that
$\dfrac{1}{2}m \dot x^2 + V(x) = E, \tag{6}$
where $E$ is a constant. QED.
$$ -\frac{dV}{dx} = m\frac{d}{dt}\frac{dx}{dt} \\ -\frac{dV}{dx}\frac{dx}{dt} = m\frac{dx}{dt}\times \frac{d}{dt}\frac{dx}{dt} $$ Now LHS is $$ -\frac{d}{dt} V(x(t)) $$and RHS is $$ m\frac{d}{dt}\left(\frac 12 \left(\frac {dx}{dt} \right)^2 \right)$$
It means that, if $m$ does not depend on $t$ (already assumed when you wrote the law of dynamics): $$ \frac{d}{dt}\left(\frac 12 m\left(\frac {dx}{dt} \right)^2 + V(x(t)) \right)=0$$