Could it be that you (or some component) is adding the Prototype library to your page? In Prototype, you select by ID using $('id') rather than $('#id'). Also, Prototype's $() function will return null if it doesn't find a match, while jQuery's $() function will never return null.
If Prototype (or another library with a $() function) is being loaded after jQuery, it would stomp all over jQuery's version of the $() function.
If it turns out this is the case, and you can't avoid using both jQuery and the other library, you'll probably want to take advantage of jQuery.noConflict.