This is the default OS X behavior. You can remap the keys by editing the default keybinding file, or, if you prefer a GUI and further extensibility, by using a program like ControllerMate.
Instructions on editing the default keybinding file can be found in this blog post. To summarize, edit the file
~/Library/KeyBindings/DefaultKeyBinding.dict or create it if it doesn't yet exist. Make it look like this:
/* Remap Home / End to be correct :-) */
"\UF729" = "moveToBeginningOfLine:"; /* Home */
"\UF72B" = "moveToEndOfLine:"; /* End */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
If there are already entries in DefaultKeyBinding.dict, just add the 4 new mappings above to the main section of your file.
Additionally, there are a couple of line movement key commands baked into OS X that may be easier on your fingers in the long run. These take you to the beginning and end of a line, respectively:
Control+a and Control+e