This is the book solution. Actually, black can also play at a, and this is probably slightly better: in either case, white still has a ko threat, but the book solution gives white a bigger threat.
Anonymous: I don't see why white would play in the above solution. I would have expected something like this as the solution. a and b are miai for the kill. If at b, then at a.
togo: Indeed, this is one white ko-threat more than in the book solution. On the other hand in tsumego the displayed opponent's plays are not necessarily the best ones.
xela: Yes, in a real game, white shouldn't play in either diagram, but should tenuki. But when solving a problem, you want to read out these variations to make sure you've understood the position properly: see main line.