[tex]\mathbf B=\begin{bmatrix}25&0\\0&4\end{bmatrix}[/tex]
Since [tex]\mathbf B[/tex] is diagonal, we have
[tex]\mathbf B^k=\begin{bmatrix}25^k&0\\0&4^k\end{bmatrix}[/tex]
Take [tex]k=\dfrac12[/tex]. Then
[tex]\mathbf A=\mathbf B^{1/2}=\begin{bmatrix}5&0\\0&2\end{bmatrix}[/tex]
[tex]\implies\mathbf A^2=\mathbf B[/tex]