## Task 1.

Determine all real numbers $a$ for which there exists a function $f: \mathbb{R} \rightarrow \mathbb{R}$ such that

$$
f(x+f(y))=f(x)+a\lfloor y\rfloor
$$

for all real numbers $x$ and $y$.

Note: $\lfloor y\rfloor$ is the greatest integer not greater than $y$. For example, $\lfloor 1.7\rfloor=1,\lfloor-\pi\rfloor=-4,\lfloor 0\rfloor=0$.
## Solution.

For $a=0$, we see that the function $f(x)=0, \forall x \in \mathbb{R}$ satisfies the condition. Now consider the case when $a \neq 0$. Let $y$ and $z$ be real numbers such that $f(y)=f(z)$. Then we have

$$
f(x)+a\lfloor y\rfloor=f(x+f(y))=f(x+f(z))=f(x)+a\lfloor z\rfloor
$$

which implies $\lfloor y\rfloor=\lfloor z\rfloor$. We call this property quasi-injectivity. Substituting $(x, y)=(0,0)$, we get $f(f(0))=f(0)$. Now, because

$$
f((n+1) f(0))=f(n f(0)+f(0))=f(n f(0))
$$

it follows by induction that $f(n f(0))=f(0)$ for every $n \in \mathbb{N}$. Quasi-injectivity gives us

$$
\lfloor n f(0)\rfloor=\lfloor f(0)\rfloor
$$

for every natural number $n$, so we conclude $f(0)=0$.

Now observe that $f(f(1))=a$.

Furthermore, substituting $(x, y)=(-f(1), 1)$, we have

$$
0=f(-f(1)+f(1))=f(-f(1))+a
$$

which implies $f(-f(1))=-a$. Substituting $(x, y)=(a,-f(1))$, we get

$$
0=f(a-a)=f(a+f(-f(1)))=f(a)+a\lfloor-f(1)\rfloor .
$$

Thus, $f(a)=-a\lfloor-f(1)\rfloor$. On the other hand, substituting $(0, f(1))$, we get

$$
f(a)=f(f(f(1)))=a\lfloor f(1)\rfloor
$$

Since $-\lfloor f(1)\rfloor=\lfloor-f(1)\rfloor$, we conclude that $f(1) \in \mathbb{Z}$, or $f(a)=a f(1)$.

For a natural number $n$, substituting $(n a, f(1))$, we get

$$
f((n+1) a)=f(n a+f(f(1)))=f(n a)+a f(1)
$$

By induction, we have $f(n a)=n a f(1)$ for every $n \in \mathbb{N}$. Also, $f(f(n))=an$ for every $n \in \mathbb{N}$.

In the following, $n$ will always be any natural number.

Substituting $(-n a, f(n))$, we get

$$
0=f(-n a+f(f(n)))=f(-n a)+a\lfloor f(n)\rfloor
$$

so $f(-n a)=-a\lfloor f(n)\rfloor$.

Substituting $(-f(n), n)$, we get

$$
0=f(-f(n)+f(n))=f(-f(n))+a n
$$

so $f(-f(n))=-n a$.

Substituting $(n a,-f(n))$, we get

$$
0=f(n a-n a)=f(n a+f(-f(n)))=f(n a)+a\lfloor-f(n)\rfloor
$$

Similarly to $f(1)$, we conclude that $f(n) \in \mathbb{Z}$. Then $anf(1) = f(n a) = a f(n)$, so $f(n)=n f(1)$.

Now we distinguish two cases depending on the sign of $f(1)$.

1. Case $f(1)>0$:

Then $f(1) \in \mathbb{N}$, so we have $a=f(f(1))=f(1)^{2}$.

2. Case $f(1)<0$:

Then $-f(1) \in \mathbb{N}$, so we have $-a=f(-f(1))=-f(1)^{2}$.

In either case, $a=f(1)^{2}$, i.e., $a$ is a perfect square. We show that a function satisfying the condition of the problem exists whenever $a$ is a perfect square.

For $a=m^{2}$, where $m$ is an integer, it is easy to see that the function $f$ defined by $f(x)=m\lfloor x\rfloor$ for every $x \in \mathbb{R}$ satisfies the condition of the problem.