If foo is any function in Sage, doing
sage: foo??
gives you the immediate source code of foo.
You can browse all the code of the core Sage library here:
http://hg.sagemath.org/sage-main/file/c239be1054e0/sage
For the standard packages, you can download them here:
http://sagemath.org/packages/standard/
Rename the extension "spkg" to ".tar.bz2" then extract them in the
standard way to extract such files on your operating system.
--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org