Let $f \in \mathcal{L}(E)$, with $E$ a finite-dimensional $\mathbb R$ vector space, s.t. $f-aId$ is $p$-nilpotent with $a<0$.
Show that there exists $g \in \mathcal{L}(E)$ s.t. $g^2 = f$ iff for all $k$ between $0$ and $p$, $\dim \ker(f-aId)^k$ is even.
For $\Leftarrow$ we should use the Jordan form.
A question in my test today. If you have ideas... I don't know if it was really difficult.
Let $b=\sqrt{-a}$, so that $b>0$. Then $\lambda=bi$ is a square root of $a=-b$ in $\mathbb C$.
For the $\Rightarrow$ direction, we must show the following :
$$ {\mathsf{dim}}({\mathsf{Ker}}((g^2+b^2Id)^k) \ \textrm{is} \ \textrm{even, for any } k\geq 0,g\in{\mathcal L}(E) \tag{1} $$
Let $Z={\mathsf{Ker}}((g^2+b^2Id)^k)$. Then $Z$ is stable by $g$, and on $Z$ the identity $(g^2+b^2Id)^k$. Temporarily passing to $\mathbb C$, this equation becomes $(g-\lambda Id)^k(g+\lambda Id)^k=0$. The kernel decomposition theorem then tells us that over $\mathbb C$, $Z=Z^{-} \oplus Z^{+}$ where $Z^{-}={\mathsf{Ker}}((g-\lambda Id)^k)$ and $Z^{+}={\mathsf{Ker}}((g+\lambda Id)^k)$. Now complex conjugation establishes a bijection between $Z^{-}$ and $Z^{+}$, so those two subspaces have the same dimension over $\mathbb C$. It follows that the dimension of $Z$ viewed as a $\mathbb C$-subspace is even. Since the dimension of $Z$ stays the same between $\mathbb R$ and $\mathbb C$, we have shown (1).
Let us now deal with the $\Leftarrow$ direction. As you suggest, we will use Jordan normal forms and suppose $E={\mathbb R}^n$ for convenience. For $1\leq k \leq p$, let $n_k$ be the number of Jordan blocks of size $k$. Then $d_k={\mathsf{dim}}({\mathsf{Ker}}((f+b^2Id)^k)$ is equal to $\sum_{j=1}^{k} jn_j+\sum_{j=k}^{p} kn_j$. So $d_k-d_{k-1}=\sum_{j=k}^p n_j$ for $1\lt k \leq p$, whence $d_k-2d_{k-1}+d_{k-2}=n_{k-1}$ for $2\lt k \leq p$. It follows that the $d_k$ are all even iff the $n_k$ are all even.
We deduce that it suffices to show the result when the Jordan normal form is made of two Jordan blocks of the same size. In this situation, if we call $q$ this common size there is a base of $E$ made of $2q$ linearly independent vectors $x_1,y_1,x_2,y_2,\ldots,x_q,y_q$ such that
$$f(x_1)=-b^2 x_1, \textrm{ and } f(x_k)=-b^2 x_k+x_{k-1} \textrm{ for } 2\leq k \leq q\tag{1}$$ $$f(y_1)=-b^2 y_1, \textrm{ and } f(y_k)=-b^2 y_k+y_{k-1} \textrm{ for } 2\leq k \leq q\tag{2}$$
Let $g$ be the element of ${\mathcal L}(E)$ uniquely defined by $g(x_k)=y_k, g(y_k)=f(x_k)$. It is easy to check that $g^2=f$, which concludes the proof.