A function is a block of code that performs a specific task. There are two types of functions: 1) built-in/library functions whose definitions are predefined in header files, and 2) user-defined functions that are created by the user to perform desired tasks. User-defined functions provide benefits like modularity, reusability, and clarity. Functions in C can be defined to take parameters and return values, take parameters but not return values, or not take parameters and not return values. Functions are called by their name followed by parentheses containing any parameters.