As clarified in the comments, the correct formulation of the problem is:
Show that the angle between the lines whose direction cosines $(l_1,m_1,n_1)$ and $(l_2,m_2,n_2)$ satisfy the equations $$l+m+n=0\tag1$$ and $$fmn+gnl+hlm=0\tag2$$ is ${\pi\over 3}$ if $${1\over f}+{1\over g}+{1\over h}=0.\tag3$$
In fact as will be shown below even stronger statement with "if" replaced by "if and only if" holds. It will be additionally assumed
$(l_1,m_1,n_1)\nparallel(l_2,m_2,n_2)$, $(f,g,h)\ne(0,0,0)$. Otherwise extra solutions are possible.
The entirety of the conditions implies that neither of $l_i,m_i,n_i$ is $0$. Indeed an assumption that any of the components - say $n_1$ - is $0$ results in combination with $(1)$ and $(2)$ in the equality $(f,g,h)=(0,0,0)$.
Observe now that equality $(1)$
$$
(l,m,n)\cdot(1,1,1)=0
$$
means that the vectors ${\bf a}_1=(l_1,m_1,n_1)$ and ${\bf a}_2=(l_2,m_2,n_2)$ are orthogonal to the vector ${\bf 1}=(1,1,1)$. This implies
${\bf a}_1\times {\bf a}_2 \parallel {\bf 1}$ or component-wise:
$$
m_1n_2-n_1m_2=n_1l_2-l_1n_2=l_1m_2-m_1l_2=\frac{\sin\alpha}{\sqrt3},\tag4
$$
where $\alpha$ is the angle between ${\bf a}_1$ and ${\bf a}_2$ which is to be found. The last equality is due to
$$
\sin^2\alpha=|{\bf a}_1\times {\bf a}_2|^2=\sum_{i=x,y,z}({\bf a}_1\times {\bf a}_2)_i^2.
$$
Similarly the equation $(2)$
$$
(f,g,h)\cdot(mn,nl,lm)=0
$$
means that the vectors ${\bf b}_1=(m_1n_1,n_1l_1,l_1m_1)$ and ${\bf b}_2=(m_2n_2,n_2l_2,l_2m_2)$ are orthogonal to the vector ${\bf c}=(f,g,h)$. This in turn implies that the vector ${\bf c}$ is collinear to the vector product
${\bf b}_1\times {\bf b}_2$, which reads component-wise:
$$\begin{align}
(f,g,h)&
=A\big(l_1l_2(n_1m_2-m_1n_2),m_1m_2(l_1n_2-n_1l_2),n_1n_2(m_1l_2-l_1m_2)\big)\\
&=\frac{A\sin\alpha}{\sqrt3}(l_1l_2,m_1m_2,n_1n_2)\tag5
\end{align}
$$
where $A$ is a non-zero constant.
We start now with the proof of the "if" part. The equations $(3)$ and $(5)$ imply:
$$
\frac{1}{l_1l_2}+\frac{1}{m_1m_2}+\frac{1}{n_1n_2}=0\tag6
$$
or
$$
m_1m_2n_1n_2+n_1n_2l_1l_2+l_1l_2m_1m_2=0.\tag7
$$
With help of $(1)$ the equation reads:
$$\begin{align}
0&=(l_1+m_1)(l_2+m_2)(l_1l_2+m_1m_2)+l_1l_2m_1m_2\\
&=(l_1l_2+m_1m_2+l_1m_2)(l_1l_2+m_1m_2+m_1l_2).\tag8
\end{align}
$$
Now we can proceed with computation of $\cos\alpha={\bf a}_1\cdot {\bf a}_2$:
$$\begin{align}
\cos\alpha
&=l_1l_2+m_1m_2+n_1n_2\\
&=l_1l_2+m_1m_2+(l_1+m_1)(l_2+m_2)\\
&=2(l_1l_2+m_1m_2)+l_1m_2+m_1l_2\\
&\stackrel{(8)}=\pm(l_1m_2-m_1l_2)\stackrel{(4)}=\pm\frac{\sin\alpha}{\sqrt3}.\tag9
\end{align}
$$
Squaring the equation one finally obtains:
$$
\cos^2\alpha=\frac13 \sin^2\alpha\implies \cos^2\alpha=\frac14 \implies \alpha=\frac\pi3.\tag{10}
$$
As already mentioned the inverse implication $\alpha={\pi\over 3}\implies {1\over f}+{1\over g}+{1\over h}=0$ holds as well, since, provided the equality $(1)$, the equations $(6)-(10)$ are equivalence relations, so that the whole argument can be easily reversed.