The function of a memory foam pet bed is to provide enhanced comfort and support for pets, particularly those with joint pain, arthritis, or mobility issues.