Almost-periodic functions and functional equations