You need to use the definition of continuity, which will involve the limit command, and the solve command to find k.
var('k')