Let $$\lim_{x\rightarrow 0} \frac{\cos(x) - 1}{x} = h$$ then $$\lim_{x\rightarrow 0}h^2 = \frac{\cos^2(x) - 2\cos(x) + 1}{x^2}$$ substituting $$\cos^2x = 1 - \sin^2x$$ gives $$\lim_{x\rightarrow 0}h^2 = \frac{2 - 2 \cos(x) - \sin^2x}{x^2}$$Since $$\lim_{x\rightarrow 0} \frac{\sin(x)}{x} = 1 $$ It squared must also equal $1$. So $$ h^2 = \lim_{x\rightarrow 0} \frac{2 - 2 \cos(x)}{x^2} - 1 = \lim_{x\rightarrow 0} 2\left(\frac{1-\cos(x) }{x}\right) . \frac{1}{x} - 1 = \lim_{x\rightarrow 0} \frac{2h}{x} - 1$$
If $h$ was a nonzero limit then the numerator would converge and since $\lim_{x\rightarrow 0}\frac{1}{x} = \infty$ the fraction would diverge to infinity. But since the limit cannot be infinity then the limit must be $0$.
You are assuming from the beginning that the limit exist, and you apply algebra of limits without knowing if it converges, so is not correct altough the answer is correct