If you use psql (command line interface), you can use \df+, as already mentioned (and this is clearly indicated in the manual).
If you need to do this from an SQL query, take a look at the system information functions . You are looking forpg_get_functiondef()
select pg_get_functiondef(oid)
from pg_proc
where proname = 'your_function';
If you are dealing with overloaded functions that have a different number of parameters, you need to include the parameter signature in the name:
select pg_get_functiondef('public.foo(int)'::regprocedure);
select pg_get_functiondef('public.foo(int,int)'::regprocedure);
foo ( int, int).