If you know for sure, that you are using this function only from the command line, you can of course place it into your initialization files.
If you plan to use it from other shell scripts too, you have to ways to go:
You can organize your programming environment around libraries consisting of one or more function definitions, which you source from those shell scripts which need them, or
You drop the idea of using functions and make executable scripts out of it.
As long as your functions are not supposed to manipulate shell variables, it's up to you which way to go. Using a separate, executable script instead of a function, has of course the advantage that it can be executed from any other program, not only from bash.