Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all real numbers $x$ and $y$,

$$
f(f(x+1)+y-1)=f(x)+y
$$

## Solutions to the exercises
Let's show that $f$ is injective: let $a, b$ be two real numbers such that $f(a)=f(b)$. When $x=0$ and $y=a+1-f(1)$, the equation becomes $f(a)=f(0)+a-1+f(1)$. Similarly, if $x=0$ and $y=b+1-f(1)$, we have $f(b)=f(0)+b-1+f(1)$, so $f(0)+a-1+f(1)=f(0)+b-1+f(1)$, hence $a=b$. We have shown that the function $f$ is injective. To use this property, we set $y=0$, then $f(f(x+1)-1)=f(x)$, and since the function is injective, $f(x+1)=x+1 \Longrightarrow f(z)=z$ for all $z$ where we have made the change of variable $z=x-1$. We verify that the function $f: x \mapsto x$ is indeed a solution to the equation.

## Remark 4.

In functional equations, showing that a function is injective goes hand in hand with finding an equality of the form $f("bidule")=f("machin")$ to deduce "bidule" = "machin".

It is necessary that such equalities be non-trivial for them to constitute progress in the exercise, which implies that "bidule" or "machin" must contain $f$. Thus, functional equations containing nested $f$s are the most conducive to using the notion of injectivity.

A simple idea that works well to obtain equalities of the form $f("bidule")=f("machin")$ is to eliminate all the output variables. In the previous exercise, we did this by setting $y=0$.

This kind of reasoning that motivates variable changes is valuable, as it saves time by avoiding trying 10 useless substitutions. However, there will always be functional equations that will require you to try many substitutions blindly until you find the right ones.

## Surjective and Bijective Functions

Definition 5. We say that a function $f: E \rightarrow F$ is surjective if for every $t \in F$, there exists $a \in E$ such that $f(a)=t$. In other words, a function is surjective if every element of the codomain has at least one preimage.

Definition 6. A function is said to be bijective if it is both injective and surjective.

## Remark 7.

A function is therefore bijective if every element of the codomain has a unique preimage.

## Remark 8.

To show that a function is surjective, we generally try to reduce it to an equation of the form $f(A)=B$, where $A$ and $B$ are expressions that depend on a variable $x$. If $B$ covers the entire codomain of $f$ as $x$ covers the same set, then $f$ is surjective.