Let $S=\{1, 2, 3, \dots 2021\}$ and $f:S \to S$ be a function such that $f^{(n)}(n)=n$ for each $n \in S$.
Find all possible values for $f(2021)$.
(Here, $f^{(n)}(n) = \underbrace{f(f(f\dots f(}_{n \text{ times} }n)))\dots))$.)

[i]Proposed by Viktor Simjanoski[/i]
1. Define \( \text{ord}(n) := \min \{k \in \mathbb{Z}^+ \mid f^k(n) = n\} \), which represents the minimal period of the sequence \( n, f(n), f^2(n), \ldots \) (its orbit). This is the smallest positive integer \( k \) such that applying the function \( f \) \( k \) times returns \( n \) to itself.

2. Given that \( f^{(n)}(n) = n \) for each \( n \in S \), it follows that \( \text{ord}(n) \mid n \). This is because the period of the sequence must divide the number of elements in the sequence.

3. Specifically, for \( n = 2021 \), we have \( \text{ord}(2021) \mid 2021 \). Since \( 2021 = 43 \cdot 47 \), the possible values for \( \text{ord}(2021) \) are the divisors of 2021, which are \( 1, 43, 47, \) and \( 2021 \).

4. Consider each possible value of \( \text{ord}(2021) \):
   - If \( \text{ord}(2021) = 1 \), then \( f(2021) = 2021 \). This is achievable by setting \( f(n) = n \) for all \( n \in S \).
   - If \( \text{ord}(2021) = 2021 \), this would imply that the sequence \( 2021, f(2021), f^2(2021), \ldots, f^{2020}(2021) \) contains 2021 distinct elements. However, this is impossible because \( f(1) = f^1(1) = 1 \), which contradicts the requirement for a 2021-cycle.
   - If \( \text{ord}(2021) = 47 \), there should be 47 elements in the orbit of 2021, all divisible by 47. However, there are only 43 multiples of 47 less than or equal to 2021, making this impossible.
   - If \( \text{ord}(2021) = 43 \), there should be 43 elements in the orbit of 2021, all divisible by 43. This is possible because there are 47 multiples of 43 less than or equal to 2021, which is sufficient to form a 43-cycle.

5. To achieve \( \text{ord}(2021) = 43 \), we can construct the function \( f \) as follows:
   - Take 43 distinct multiples of 43 in the order \( 43m_1 = 2021, 43m_2, 43m_3, \ldots, 43m_{43} \).
   - Define \( f(43m_k) = 43m_{k+1} \) for \( k \) taken modulo 43.
   - Define \( f(n) = n \) for all other \( n \in S \).

6. This construction ensures that there is one 43-cycle and many 1-cycles, satisfying the condition \( f^{(n)}(n) = n \) for all \( n \in S \).

Conclusion:
The set of all possible values achievable by \( f(2021) \) is the set of multiples of 43.

The final answer is \( \boxed{ \{43, 86, 129, 172, 215, 258, 301, 344, 387, 430, 473, 516, 559, 602, 645, 688, 731, 774, 817, 860, 903, 946, 989, 1032, 1075, 1118, 1161, 1204, 1247, 1290, 1333, 1376, 1419, 1462, 1505, 1548, 1591, 1634, 1677, 1720, 1763, 1806, 1849, 1892, 1935, 1978, 2021\} } \).