Given your $A$, write its Jordan form. Because here the matrices are $3\times 3$, there is not much room for things to happen:
1) If $A$ has three different eigenvalues, then $A=SJS^{-1}$ with $J$ diagonal. Now choose a diagonal matrix $X$ such thath $X_{jj}^2=J_{jj}$. Then $SXS^{-1}$ is is a square root of $A$.
2) If $A$ has a repeated eigenvalue, its Jordan form may still be diagonal, and 1) applies.
3) If $A$ has a $2\times2$ Jordan block, $J$, then $J=\lambda_1 I_2+N$ with $N$ nilpotent. Then $\lambda_1^{1/2}+\frac1{2\lambda_1^{1/2}}N$ is a square root for $J$; as $$A=\begin{bmatrix}J&0\\0&\lambda_2\end{bmatrix},$$ it has a square root $$\begin{bmatrix}\lambda_1^{1/2}+\frac1{2\lambda_1^{1/2}}N&0\\0&\lambda_2^{1/2}\end{bmatrix}.$$
4) If $A=SJS^{-1}$ with $J$ a $3\times 3$ Jordan block, then $J=\lambda I+N$; now the exercise you quoted shows that $$C=I+\frac N2-\frac{N^2}8$$ is a square root of $I+N$. Then $$\lambda^{1/2}\left(I+\frac N{2\lambda}-\frac{N^2}{8\lambda^2}\right)$$ is a square root for $A$.
The fact that $A$ is invertible is used to guarantee that all eigenvalues are nonzero. For instance, if $$A=\begin{bmatrix}0&1\\0&0\end{bmatrix},$$ then no $B$ exists such that $B^2=A$.