Problem

Source: FKMO 2022 Problem 3

Tags: functional equation, algebra



A function $g \colon \mathbb{R} \to \mathbb{R}$ is given such that its range is a finite set. Find all functions $f \colon \mathbb{R} \to \mathbb{R}$ that satisfies $$2f(x+g(y))=f(2g(x)+y)+f(x+3g(y))$$for all $x, y \in \mathbb{R}$.