Find all functions $f: \mathbb{N} \rightarrow \mathbb{Z}$ such that $|f(k)| \leq k$ for all positive integers $k$ and there is a prime number $p>2024$ which satisfies both of the following conditions: $1)$ For all $a \in \mathbb{N}$ we have $af(a+p) = af(a)+pf(a),$ $2)$ For all $a \in \mathbb{N}$ we have $p|a^{\frac{p+1}{2}}-f(a).$ Proposed by Nikola Velov
Problem
Source: 5th Memorial Mathematical Competition "Aleksandar Blazhevski - Cane" - Senior - Problem 3
Tags: function, number theory