This is a problem from Ted Shifrin's book on Mutivariable Mathematics, I have asked a similar question earlier, but as I am revisiting this problem after 3 years, I realized my old question and answer do not provide a satisfactory or comprehensive answer.
Given $\mathbf{f}: A \mapsto A^2$, for $A \in \mathbb{R}^{n \times n}$.
(a) Applying the Inverse Function Theorem, show that every matrix $B$ in a neighbourhood of $I$ has (atleast) 2 square roots $A$, that is $A^2 = B$, each varying as a $C^1$ function of $B$.
(b) Can you decide if there are precisely 2 or more ? (Hint: in 2x2 case, what is $D\mathbf{f}\left ( \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \right )$ ?
I am able to solve part (a) by observing that $f(\pm I) = I$, so the inverse function theorem can be applied to the map $\mathbf{f}$ at $A =I$ and $A= -I$. Thus it asserts the existence of inverse functions $\phi_1, \phi_2$ so that, two square roots are accounted for, and I have shown that there exist at least 2 square roots.
My question pertains to part (b).
I can see that Inverse function theorem does not apply, since the map $D\mathbf{f}\left ( \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \right )$ is not invertible.
However, $ f\left ( \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \right ) = I $.
Since the map $f$ is continuous, for a given $\epsilon > 0$, one can find $\delta > 0$ so that $X \in \delta-$neighbourhood of $\begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}$ will be mapped by $f$ to $\epsilon-$neighbourhood of $I$.
Thus there exist $B$ near $I$ that have distinct pre-images (square roots) in the neighbourhoods of $I, -I, \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}$.
At this point, I can only conclude that
1) I can construct a neighbourhood aroundn $I$ wherein every $B$ has 2 square roots
2) For some $B$, there might be a third square root.
Q) So how can I definitively answer (b), that is, decide if there are precisely 2 or more square roots for $B$ in the neighbourhood of $I$?
In fact, any reflection (across a line in $\Bbb R^2$ or across any nontrivial subspace in higher dimensions) gives a square root of $I$. The matrix $A_0=\begin{bmatrix} 1 & 0 \\ 0 & -1\end{bmatrix}$ gives an example, of course. $D\mathbf f(A_0)$ has a $2$-dimensional nullspace, accounting for varying the $\pm 1$-eigenspaces of the reflection. However, as was already pointed out in the answer to your first question, there are matrices arbitrarily close to $I$ (e.g., $\begin{bmatrix} 1 & \epsilon \\ 0 & 1\end{bmatrix}$) having no square root near $A_0$ (or, indeed, any other reflection matrix). So $\mathbf f$ is a local diffeomorphism, as expected, only at $\pm I$, not at any other preimages of $I$.