If function f : R --> R where f(X)=X³ - kX² + 12X - 7 is a one to one function, then k belongs to....

Since f(x) is a cubic polynomial, it has at most 3 distinct roots. If f(x) has 3 real roots, then f(x) = 0 for more than one instance of x.
But if f(x) is one-to-one, then there must be only one real root and the other two are non-real. Let a + bi and a - bi be these non-real roots and c the single real root; then we can factorize f(x) as
[tex]f(x) = x^3 - kx^2 + 12x + 7 = (x - (a + bi)) (x - (a - bi)) (x - c)[/tex]
Expand the right side to get
[tex]f(x) = x^3 - kx^2 + 12x + 7 = (x^2 - 2ax + a^2+b^2) (x - c)[/tex]
[tex]f(x) = x^3 - kx^2 + 12x + 7 = x^3 - (2a + c) x^2 + (a^2 + 2ac + b^2) x - (a^2c + b^2c)[/tex]
from which it follows that
[tex]\begin{cases}k = 2a + c \\ 12 = a^2+2ac+b^2 \\ 7 = -a^2c-b^2c\end{cases}[/tex]
Since f(x) has only one root, its graph will have no turning points/extrema. If f(x) has a critical point, it must be a saddle point. Differentiating f(x) yields
[tex]f'(x) = 3x^2 - 2kx + 12[/tex]
Solve for the critical point:
[tex]f'(x) = 3x^2 - 2kx + 12 = 0[/tex]
[tex]x^2 - \dfrac{2k}3 x = -4[/tex]
[tex]x^2 - \dfrac{2k}3 x + \dfrac{k^2}9 = \dfrac{k^2}9-4[/tex]
[tex]\left(x - \dfrac k3\right)^2 = \dfrac{k^2}9-4[/tex]
[tex]x = \dfrac k3 \pm \sqrt{\dfrac{k^2}9-4}[/tex]
There is at most one real critical point, so either the square root term vanishes or it produces a non-real number. This happens for
[tex]\dfrac{k^2}9 - 4 \le 0 \implies k^2 \le 36 \implies -6 \le k \le 6[/tex]
So, if f(x) is one-to-one, then
[tex]k \in \left\{\kappa \in \Bbb R \mid -6 \le \kappa \le 6\right\}[/tex]