Fréchét derivative, its inverse and existense of a solution to $X^2 = B$ in an open subset of $M_2 (\mathbb{R})$ Let $A = \operatorname{diag}(\lambda_1, \lambda_2) $ and let $f:M_2 (\mathbb{R}) \to M_2 (\mathbb{R}), f(X)= X^2$. We consider an arbitrary matrix norm.
If we look at the Fréchét derivative at $A$ of $f$ then we have $f'(A) H=AH + HA$. 
The first question asks to show that $f'(A)$ is invertible iff $ \lambda_i \neq 0 $ and $ \lambda_1 + \lambda_2 \neq 0$ which is not hard to show. [edited]


*

*I need to show that the equation $X^2 =B$ has a solution for $B$ in some neighbourhood of $B_0= \operatorname{diag}(4,1)$. My idea is to consider $g(X)= f(X) -B +X$ and show that a fixed point of $g$ exists, using the Banach fixed point theorem. However (if this is the right idea) I fail to see how to show that $g$ is $q<1$ Lipschitz at a complete subset of $M_2(\mathbb{R}).$

 A: You are right in trying to rewrite your equation in a fixed-point form to then apply the contraction lemma. That's going to work but you have to do it properly. The scheme you want to mimic is the proof of the $C^1$ inverse function theorem, see e.g. here (in the very first lines). Let me reproduce it here. 
Sketchy proof of the inverse function theorem (based on the contraction lemma). 
Let $X$ be some Banach space. One wants to solve the equation
$$\tag{*}y=f(x)$$
where $f\colon X\to X$ is $C^1$ and such that $f(x_0)=y_0$ and $f'(x_0)=L$ is nonsingular. The tools to use are the mean value theorem and the contraction lemma. First, one normalizes the equation by substituting $f$ with 
$$
g(x)=L^{-1}(f(x_0+x)-y_0), $$
so that $g(0)=0$ and that $g'(0)=I$ (identity operator). The equation (*) becomes now $g(x)=y$ and it has to be solved for $x$ and $y$ in some neighborhood of the origin. One rewrites (*) in fixed point form 
$$T_y(x)\overset{\rm def}{=}y+x-g(x)=x, $$
and one observes that $DT_y(0)=0$, and so $T_y$ has a tiny Lipschitz constant on small enough neighborhoods of the origin. This enables the use of the contraction mapping principle. $\square$
What you are trying to do
You are essentially trying to reproduce the above argument to solve the equation 
$$\tag{**} X^2 = B,$$ 
knowing that $X_0^2=B_0$ and that $L\overset{\rm def}{=}\left.D(X^2)\right|_{X=X_0}$ is nonsingular. You tried to rewrite (**) in fixed point form, but you forgot to normalize: you wrote 
$$
T_B(X)=X^2-B+X=X, $$
and this is NOT going to work, because $DT_B(X_0)\ne 0$. Try this instead: 
$$
T_B(X)=(L^{-1}X + X_0)^2 - B +X = X,$$
where $X$ is in some small neighborhood of the origin. Or 
$$
T_B(X)=L^{-1}(X+X_0)^2 - B + X = X.$$
