Problem

Source: India Postals Set 3

Tags: algebra, functional equation



Let $f:\mathbb{N} \cup \{0\} \to \mathbb{N} \cup \{0\}$ be defined by $f(0)=0$, $$f(2n+1)=2f(n)$$for $n \ge 0$ and $$f(2n)=2f(n)+1$$for $n \ge 1$ If $g(n)=f(f(n))$, prove that $g(n-g(n))=0$ for all $n \ge 0$.