On a Functional Equation Related to Two-Sided Centralizers