Let $$ g\bigl(h(t)\bigr) = \cos(\sqrt{t}) $$ and $$ g(t) = \cos(t) $$ and $$ h(t) = \sqrt{t}. $$ Verify that $$ \frac{dg}{dh} = \frac{\;\frac{dg}{dt}\;}{\frac{dh}{dt}}. $$
I tried doing this but I got $$ \frac{dg}{dh} = -\sin(\sqrt{t}) \cdot \frac{1}{2\sqrt{t}} $$ but that is not equal to $$ \frac{\frac{dg}{dt}}{\frac{dh}{dt}} = -2\sin(t) \cdot \sqrt{t} $$
Where did I make a mistake? Edit: I see the mistake but I tried another method and I don't know why that is wrong. $$\frac{dg}{dh}=-sin\left(h\right)\cdot \frac{dh}{dh}=-sin\left(\sqrt{t}\right)$$
The first derivative you found is $\dfrac{dg(h(t))}{dt}$, whereas you must compute $\dfrac{dg}{dh}$.
Since $h(t)=\sqrt t$, you have $g(t) = \cos(h(t)^2)$, and so
$$\frac{dg}{dh} = -\sin(h(t)^2) \cdot 2 h(t) = -2\sqrt t\,\sin(t)$$
On the other hand, by the chain rule,
$$\frac{dg}{dh} = \frac{\frac{dg}{dt}}{\frac{dh}{dt}} = \frac{-\sin(t)}{\frac1{2\sqrt t}} = -2\sqrt t\,\sin(t)$$