It should be OK to publish your source code under any license or other instrument you want, including a CC-0 public domain dedication.
Open-Source licenses are primarily copyright-based, not contract-based. Thus, they can only apply to the original creative work, and any derivative works. There is a good argument that if software code references some library but does not include any parts of the library in any form, then the code isn't derived from the library in the sense of copyright law. But there's a good debate to be had here, especially in an U.S. context since the Google v Oracle dispute about API copyrightability.
When the library is Apache-2.0 licensed, then any of this doesn't matter though.
- Apache-2.0 explicitly does not affect your code.
- Even if it would apply, you would be largely free to do what you want.
The Apache-2.0 license defines what it considers to be a “derivative work” that would have to comply with the license conditions. But part of the definition is the following:
For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
Your source code is completely separable from the Apache-covered library. It does not itself include any parts of the library (and only instructions to include parts during compilation). Your source code links to the library, and for this purpose naming parts of that library is necessary.
So, your source code is not affected by Apache-2.0, and you can license it however you want.
But let's consider what would happen if this provision didn't exist, and if your software did qualify as a derivative work of the Apache-covered library. For example, this might happen if you modify the library, or if you statically link it into a binary with your code.
Then, we would have to consider the license conditions in Section 4 of the license: we have to give users a copy of the license, give prominent notice of changes, keep intact all legal notices in the source code, and must give users access to the NOTICE file, if it exists.
But none of these conditions require you to license the derivative work as a whole in any particular way – unlike copyleft licenses like the GPL family.
You wouldn't be able to publish the derivative work as a whole under CC-0. Only the copyright holder can do that, and you are not the copyright holder for the Apache-covered parts. But you would be free to publish the parts that you wrote under CC-0. The result would be a software where some parts are CC-0 / public domain, with other parts being covered by Apache-2.0. This is actually a fairly common combination, especially on Android, where the public domain SQLite database engine is frequently used, with many other libraries using Apache-2.0.