On Certain Functional Equations and Mean Value Theorems