How should I use hook_init()?
hook_init() must be implemented in a custom module. In your example, the function mymodule_init() would go into a file named mymodule.module in a custom module named mymodule. You would also supply a simple mymodule.info file and put both files in the sites/sitename/modules/mymodule directory. 

The custom module must be enabled like any other. Also, when creating a hook implementation, it is usually necessary to clear the cache for Drupal to recognize it. Finally, note that mymodule needs to be a unique name different from other modules or themes.

As a minor usage point, current_path() returns the current URL which may not be the current alias (e.g., node/5). Using drupal_get_path_alias() is recommended to always return a friendly alias.