Functions allow programmers to organize code into self-contained blocks that perform tasks. A function is defined with a name, parameters, and code block. Functions can call other functions or recurse by calling themselves. Recursion involves defining a function that calls itself repeatedly until a base case is reached. Examples of recursive functions include calculating factorials and solving the Tower of Hanoi puzzle by moving disks from one rod to another according to rules.