EXPLAIN ANALYZE shows no details for queries inside a plpgsql function
The correct syntax for the EXPLAIN call needs a SELECT. You can't just write the bare function name in SQL:
EXPLAIN ANALYZE SELECT f1();
Optimization
PL/pgSQL functions are black boxes to the query planner. Queries inside are optimized just like other queries, but separately and one by one like prepared statements, and the execution plan may be cached for the duration of the session. Details:

Function Performance

EXPLAIN function bodies
Like @Daniel already commented, you can use the additional module auto_explain to get more details (lots of details). Statements inside plpgsql functions are considered &quot;nested statements&quot;. Be sure to set:
SET auto_explain.log_nested_statements = ON;

Detailed instructions:

Postgres query plan of a function invocation written in plpgsql

As an exception to the rule, simple SQL functions (not plpgsql) may be &quot;inlined&quot;, i.e. the function code is inserted into the outer query and everything is executed like there wasn't a function to begin with. The query plan includes detailed information in such cases.