A subprogram can be declared in the package body but not in the package specification. It can only be called within the package itself (by itself or another subprogram). If you need to call your subprogram outside of the package itself, you must declare it in the package specification.
select test_package.f3() from dual;
The function f3 is defined in the package body, but is not visible from outside the package because it is not defined in the package specification. Attempting to run this query results in an error.
select test_package.f4() from dual;
The function f3 is visible to function f4, which is exposed in the package specification. This query will run successfully, and return a result from f3 through f4.