The answer is actually a good deal more subtle than that. Start by thinking about f(n) when n is small. We know that f(f(1)) = 3, and that f is an increasing function. That means that f(1) must be 2 (since that is the only available number greater than 1 and less than 3). Then f(2) = f(f(1)) = 3. Next, f(f(2)) = 6, in other words f(3) = 6, and therefore f(6) = f(f(3)) = 9. But f(4) and f(5) must be sandwiched between f(3) and f(6), which implies that f(4) = 7 and f(5) = 8.
Continuing in that way, you see that f(n) is uniquely determined for each n, and that f(n) seems to increase in steps of either 1 or 3. That suggests that it might be helpful to express n in base 3.
Here's my answer: