The Golgi apparatus is responsible for modifying, sorting, and packaging proteins and lipids for transport within or outside the cell.