$ \displaystyle\lim_{x \to 0} \frac{1+cosx-2cos^2x}{x^2} = $
$ = \displaystyle\lim_{x \to 0} \frac{1-cos^2 x+cosx-cos^2x}{x^2} = $
$ = \displaystyle\lim_{x \to 0} \frac{sin^2 x+cosx(1-cosx)}{x^2} = $
$ = \displaystyle\lim_{x \to 0} \frac{sin^2 x}{x^2} + cos x \frac{1-cosx}{x^2} = 1 + 1 \cdot \frac{1}{2} = \frac{3}{2} $