In order to make f(x) continuous, just equate the equations at the borders of the intervals:
2mx^2 - kx + 1 = x^3 - 1 at x = -1 and
2mx^2 - kx + 1 = (1-4x)/5 at x = 2
This leads to linear simultaneous equations in k and m that can then be solved for k and m.
Good luck.
Strictly speaking, the middle intermal only needs to approach the correct values as a limit approaching -1 and 2.