As a noun, meaning "purpose" or "role":
* The function of a heart is to pump blood throughout the body.
* What is the function of this button?
* The function of a teacher is to educate students.
As a noun, meaning "a mathematical relationship":
* In mathematics, a function assigns a unique output value to each input value.
* The function f(x) = x^2 describes the relationship between a number and its square.
As a verb, meaning "to operate" or "to work":
* The washing machine functions properly now.
* The engine functions best at high speeds.
* The website is no longer functioning correctly.
As a verb, meaning "to perform a specific task"
* The doctor functions as both a healer and a counselor.
* This app functions as a calendar and a task manager.
The meaning of "function" will depend on the context of the sentence.