I think that the thing that makes mathematics worthwhile is the fact that it has this incredible structure that you can explore and discover.
The ending of a mystery novel is often unexpected, yet it makes perfect sense.