Let a be the length of an edge of the cube and let one corner be at the origin as shown in the figure. Clearly, $\text{OP, AR}$
The direction ratiosm of $\text{OP, AR, BS}$ and $\text{CQ}$ are
$a - 0, a - 0, a - 0,$ i.e. $a, a, a$
$0 - a, a - 0, a - 0,$ i.e. $-a, a, a$
$a - 0, 0 - a, a - 0,$ i.e. $a, -a, a$
$a - 0, a - 0, 0 - a,$ i.e. $a, a, -a$
Let the direction ratios of a line be proportional to $l, m$ and $n.$
Suppose this line makes angles $\alpha,\beta,\gamma$ and $\delta$ with $\text{OP, AR.}$
Now, $\alpha$ is the angle between $OP$ and the line whose direction ratios are proportional to $l, m$ and $n.$
$\cos\alpha=\frac{\text{a}.\text{l}+\text{a}.\text{m}+\text{a}.\text{n}}{\sqrt{\text{a}^2+\text{a}^2+\text{a}^2}\sqrt{\text{l}^2+\text{m}^2+\text{n}^2}}$
$\Rightarrow\cos\alpha=\frac{\text{l}+\text{m}+\text{n}}{\sqrt{3}\sqrt{\text{l}^2+\text{m}^2+\text{n}^2}}$
Since $\beta$ is the angle between $AR$ and the line with direction ratios proportional to $l, m$ and $n,$ we get
$\cos\beta=\frac{-\text{a}.\text{l}+\text{a}.\text{m}+\text{a}.\text{n}}{\sqrt{\text{a}^2+\text{a}^2+\text{a}^2}\sqrt{\text{l}^2+\text{m}^2+\text{n}^2}}$
$\Rightarrow\cos\beta=\frac{-\text{l}+\text{m}+\text{n}}{\sqrt{3}\sqrt{\text{l}^2+\text{m}^2+\text{n}^2}}$
Similarly,
$\cos\gamma=\frac{\text{a}.\text{l}-\text{a}.\text{m}+\text{a}.\text{n}}{\sqrt{\text{a}^2+\text{a}^2+\text{a}^2}\sqrt{\text{l}^2+\text{m}^2+\text{n}^2}}$
$\Rightarrow\cos\gamma=\frac{\text{l}-\text{m}+\text{n}}{\sqrt{3}\sqrt{\text{l}^2+\text{m}^2+\text{n}^2}}$
$\cos\delta=\frac{\text{a}.\text{l}+\text{a}.\text{m}-\text{a}.\text{n}}{\sqrt{\text{a}^2+\text{a}^2+\text{a}^2}\sqrt{\text{l}^2+\text{m}^2+\text{n}^2}}$
$\Rightarrow\cos\delta=\frac{\text{l}+\text{m}-\text{n}}{\sqrt{3}\sqrt{\text{l}^2+\text{m}^2+\text{n}^2}}$
$\cos^2\alpha+\cos^2\beta+\cos^2\gamma+\cos^2\delta$
$=\frac{(\text{l}+\text{m}+\text{n})^2}{3(\text{l}^2+\text{m}^2+\text{n}^2)}+\frac{(-\text{l}+\text{m}+\text{n})^2}{3(\text{l}^2+\text{m}^2+\text{n}^2)}+\frac{(\text{l}-\text{m}+\text{n})^2}{3(\text{l}^2+\text{m}^2+\text{n}^2)}+\frac{(\text{l}+\text{m}-\text{n})^2}{\sqrt{3}\sqrt{\text{l}^2+\text{m}^2+\text{n}^2}}$
$=\frac{1}{3(\text{l}^2+\text{m}^2+\text{n}^2)}\Big\{(\text{l}+\text{m}+\text{n})^2+(-\text{l}+\text{m}+\text{n})^2+(\text{l}-\text{m}+\text{n})^2+(\text{l}+\text{m}-\text{n})^2\Big\}$
$=\frac{1}{3(\text{l}^2+\text{m}^2+\text{n}^2)}4\big(\text{l}^2+\text{m}^2+\text{n}^2\big)$
$=\frac{4}{3}$.