The solution that is the easiest to understand for everyone is to have the function that comes from the Apache licensed library in a separate source file.
Then you can just use the normal copyright and license comments, as appropriate for the license of that file, at the top of each file.
It is possible to have both portions in a single source file.
If you choose this route, then you must make it clear at the top op the file that some functions are also under another license.
Then, next to the functions that are under the Apache license, include the Apache license comment there.
As in this case the copyright on parts of your source file are owned by the copyright holders of the library from which you included a function, you need to add their copyright statement also to the copyright statement of your file.