Are the lymphatic system and immune system the same? If not, what is the function of the immune system?
Lymphatic and immune systems are not technically same, though they are related.
We have a closed circulatory system where blood flows through capillaries to supply oxygen to tissues. Some amount of water leaks out in the tissues from blood:- though most of this reenters circulation, about 2L fluid accumulates as tissue fluid every day, in an adult. White blood cells also come out of capillaries by diapedesis (amoeboid movement through pores in basement membrane) to appear in tissue fluid.
Our body has developed a system to drain this tissue fluid plus WBCs (=lymph) into blood again. The material is called lymph and it drains very slowly via two large thoracic ducts in subclavian veins.
Lymphatic ducts also collect dietary fat and fat-soluble vitamins and ultimately fat mixes with blood along with lymph.
Lymphatic system is loaded with cells which are able to fight with disease causing organisms (which are able to infect our body). This way lymphatic system becomes associated with immune system.
Immune system on the other hand is a collection of different cells in various organs and tissues which defend our body from pathogenic organisms. Though WBCs are the most dedicated soldiers of immune system, even dead superficial layer of skin has role in immunity.