Not everyone is doing responsive design so there's a pretty good chance you're going to need to know how to detect mobile devices. We've approached the topic lightly before but now let's get serious.
This topic has the potential to start a geek war. On one side you have people who proclaim the virtues of community-maintained databases that perform mobile detection on the server side. WURFL is a prime example. Using it, we can get a lot of information about the device that is visiting our sites. Listing it all here would just be a waste of space. Check out http://www.tera-wurfl.com/explore/index.php to see it in action or view the entire list of capabilities at http://www.scientiamobile.com/wurflCapability/.
On the other side of the debate, people point out that the server-side detection (even when it is database driven) can lead to brand new devices not being recognized until...