Find all the functions $f:\mathbb{Z}^+ \to \mathbb{Z}^+$ such that $f(f(x)) = 15x-2f(x)+48$. 
Find all the functions $f:\mathbb{Z}^+ \to \mathbb{Z}^+$ such that $f(f(x)) = 15x-2f(x)+48$.

If $f$ is a polynomial of degree $n$, we have that $\deg(f(f(x))) = n^2$ and $\deg(15x-2f(x)+48)=n$. Therefore, the only possible polynomials that satisfy the condition have degree $0$ or $1$.
Let $f:\mathbb{Z}^+ \to \mathbb{Z}^+$ be a function that holds the condition of the problem given by $f(x)=ax+b$ for some constants $a$ and $b$. Since $$f(f(x)) = f(ax+b) = a(ax+b)+b = a^2x + (a+1)b$$ and $$15x-2f(x)+48 = 15x-2(ax+b)+48 = (15-2a)x+(48-2b),$$ it follows that
$$a^2+2a-15=0 \quad\text{and}\quad (a+1)b=48-2b.$$ From the first equation, we get that $a=-5$ or $a=3$. If $a=-5$, from the second equation we get that $b=-24$, and it contradicts that $f[\mathbb{Z}^+]\subseteq \mathbb{Z}^+$. If $a=3$, then $b=8$. Therefore, $f(x)=3x+8$ is the only polynomial that satisfies the condition of the problem.  I guess that this is the only solution, but I do not know how to prove it.
Edit: I was trying to prove that the iterations of any function $f$ that satisfies the problem have the same behaviour. For instance, by iterating $f$ we have that $2f^3(x)+f^4(x)-15f^2(x)=48$, so this functions are almost the same except for constant terms. Is this usefull this idea to complete the problem?
 A: Put $a_0=a \in \mathbb{Z}^{+}$ arbitrary and $a_n=f(a_{n-1})$ for $n \geq 1$. The functional equation gives a non-homogenous linear recurrence
$$
a_{n}=-2a_{n-1}+15a_{n-2}+48.
$$
Homogenizing it by substitution $b_n=a_n+4$ we get
$$
b_n=-2b_{n-1}+15b_{n-2}.
$$
The characteristic equation is $x^2+2x-15=(x+5)(x-3)$, hence by the standard result for linear recurrences we have some constants $A,B$ such that
$$
a_n=A3^n+B(-5)^n-4.
$$
If $B\neq 0$, the term $(-5)^n$ will dominate over $3^n$ in $a_n$ for sufficiently large $n$, regardless of value of $A$. Hence $a_n$ will be arbitrary large negative or positive value, based on the parity of $n$. However, we know $a_n=f(a_{n-1})$ must be positive for $n \geq 1$, thus $B=0$. Also from $n=0$ we find $A=a+4$, and overall
$$
a_n=3^n(a+4)-4.
$$
Finally, from $n=1$ we obtain $f(a)=a_1=3(a+4)-4=3a+8$. Since $a$ was arbitrarily chosen, we have $f(x)\equiv 3x+8$. Plugging back to the functional equation verifies it is indeed a solution and by the above construction also the only one.
A: Let us study the two variable affine transformation $g:\Bbb{R}^2\to\Bbb{R}^2$
$$
g(x,y)=(y,15x-2y+48).
$$
The connection to the problem is, of course, that $g(x,f(x))=(f(x),f(f(x)))$. I am using the idea from Tob's answer that unless we are on the straight and narrow path of $f(x)=3x+8$ we will diverge to a point where negative values will appear.
The linear part of the transformation $g$ comes from the matrix
$$
A=\left(\begin{array}{rr}0&1\\ 15&-2\end{array}\right).
$$
Suggestively, the eigenvalues of $A$ are $\lambda_1=3$ with eigenvector $(1,3)^T$ and $\lambda_2=-5$ with eigenvector $(1,-5)^T$. The idea is that if we iterate $g$ from a starting point that has a non-zero component belonging to that large negative eigenvalue, then eventually $(-5)^m$ dominates over $3^m$, kicking us out of the positive zone.
Let's first linearize. We easily find that $P=(-4,-4)$ is a fixed point of $g$ (as $P$ is on the expected line $y=3x+8$ this, again, boosts our optimism). So if we move the origin to $P$ we need to write $u=x+4, v=y+4$, and replace $g(x,y)$ with
$$h(u,v)=(v,15u-2v).$$
The connection to the functional equation now reads:
$$
h(x+4,f(x)+4)=(f(x)+4,f(f(x))+4).
$$
We can now prove that we run into a contradiction, if $f(a)=b\neq 3a+8$ for some integer $a>0$. We write $(a+4,b+4)$ using the eigenbasis above
$$
(a+4,b+4)=c_1(1,3)+c_2(1,-5).
$$
The contrapositive assumption is equivalent to $c_2\neq0$.
When we iterate $m$ times we arrive at
$$
(a_m+4,b_m+4)=3^mc_1(1,3)+(-5)^mc_2(1,-5),
$$
where, $a_0=a$, $b_0=b$ and for all $m>0$, $b_m=f(a_m)$ and $a_{m+1}=b_m$.
It is then clear that the assumption $c_2\neq0$ forces $b_m<0$ for some large enough value of $m$, which is a contradiction.
