First book I ever picked up on the subject was "Comedy Writing" by Mervin Hellitzer. A bit dry, sometimes dated, but still accessible and covers the fundamentals reasonably well. Also be sure to pay attention to what the best comedians have to say about comedy writing. As an example, there's...