The equation k = |f(x)| may have 2, 4, 6, 7 and 8 roots. Some of these numbers of roots are obtained when k is not an integer, though.

Let -m be the minimum of , i.e., is the minimum of f(x). According to my calculations, m > f(0) (0 is one of the critical points of f(x)). Therefore, when , the equation has two roots. From the inequality you can find the range of for k = 2. Then find whether gives an integer . When , the equation has 6 roots. Solving gives you the values of for k = 6, and so on.