Let N\mathbb{N} be the set of positive integers. Determine all positive integers kk for which there exist functions f ⁣:NNf\colon \mathbb{N}\to \mathbb{N} and g ⁣:NNg\colon \mathbb{N}\to \mathbb{N} such that gg assumes infinitely many values and such that

fg(n)(n)=f(n)+kf^{g(n)}(n) = f(n) + k

holds for every positive integer nn.

(Remark. Here, fif^i denotes the function ff applied ii times, i.e., fi(j)=f(f(f(f(j))))i timesf^i(j) = \underbrace{f(f(\ldots f(f(j)) \ldots))}_{i \text{ times}}.)