$x^4 - (k-1)x^2+(2 - k) = 0 ~~~\cdots(1)$
Assuming $x^2= t$,
$t^2 - (k-1)t +(2-k) = 0~~~ \cdots(2)$
Let roots of the equation $(2)$ be $t_1,t_2~(t_1 \le t_2)$
Equation $(1)$ will have three distinct real roots iff for equation $(2)$,
$t_1 = 0,~~t_2 \gt 0$
$(i)~f(0) = 0\\
\Rightarrow 2 - k = 0\Rightarrow k = 2~~~ \cdots(3)\\
(ii)~-\dfrac{b}{2a} \gt 0\\
\Rightarrow \dfrac{k-1}{2} \gt 0\\
\Rightarrow k \gt 1~~~ \cdots(4)$
From equation $(3)$ and $(4)$,
$k = 2$