Let OABCDEFG be a cube with vertices as below
O(0,0,0), A(a,0,0), B(a,a,0), C(0,a,0),
D(0,a,a), E(0,0,a), F(a,0,a) and G(a,a,a)
There are four diagonals OG,CF,AD and BE for the cube.
Let us consider any two say OG and AD
We know that if $A(x_1,y_1,z_1)\:\:and\:\:B(x_2,y_2,z_2)$ are two points in space then $\overrightarrow {AB}=(x_2-x_1)\hat i+(y_2-y_1)\hat j+(z_2-z_1)\hat k$
$\Rightarrow\:\overrightarrow {OG}=(a-0)\hat i+(a-0)\hat j+(a-0)\hat k=a\hat i+a\hat j+a\hat k$ and
$\overrightarrow {AD}=(0-a)\hat i+(a-0)\hat j+(a-0)\hat k=-a\hat i+a\hat j+a\hat k$
$|\overrightarrow {OG}|=\sqrt{a^2+a^2+a^2}=\sqrt3a$
$|\overrightarrow {AD}|=\sqrt{(-a)^2+a^2+a^2}=\sqrt3a$
$\overrightarrow {OG}.\overrightarrow {AD}=-a^2+a^2+a^2=a^2$
We know that angle between any two vectors $\overrightarrow a\:and\:\overrightarrow b$ $= cos^{-1}\bigg(\frac{\overrightarrow a.\overrightarrow b}{|\overrightarrow a||\overrightarrow b|}\bigg)$
$\Rightarrow\:$Angle between the two diagonals $ \overrightarrow {OG}$ and $\overrightarrow {AD}$=
$cos^{-1}\bigg(\frac{\overrightarrow {OG}.\overrightarrow {AD}}{|\overrightarrow {OG}||\overrightarrow {AD}|}\bigg)$
$=cos^{-1}\bigg(\frac{a^2}{\sqrt3a.\sqrt3a}\bigg)=cos^{-1}\frac{a^2}{3a^2}$
$=\large\:cos^{-1}\frac{1}{3}$
Hence proved.