Given, $g(x)=x^{2}+x-2$
and $\frac{1}{2}(g o f)(x)=2 x^{2}-5 x+2$
$\Rightarrow g(f(x))=4 x^{2}-10 x+4$
$\Rightarrow (f(x))^{2}+(f(x))-2=4 x^{2}-10 x+4$
Now, it is necessary that $f(x)$ should be linear polynomial expression,
so let $f(x)=a x +b$, then
$(a x +b)^{2}+(a x +b)-2=4 x^{2}-10 x+4$
$\Rightarrow a^{2} x^{2}+(2 a b +a) x+\left(b^{2}+b-2\right)$
$=4 x^{2}-10 x+4$
On comparing the coefficient of different kind of terms, we are getting
$a^{2}=4$
$\Rightarrow 2 a b +a=-10$
and $b^{2}+b-2=4$
So, $a=\pm 2,$
then $b =
\begin{cases}
-3, & \text{if $a=2$ } \\
2, & \text{if $a-2$}
\end{cases}$
and these value satisfy the all above relations, so
$f(x)=2 x-3 \text { or }-2 x+2$