The function $f(x)$ for each value of $x \in(-\infty,+\infty)$ satisfies the equation $f(x)+(x+1 / 2) f(1-x)=1$.

a) Find $f(0)$ and $f(1)$.

b) Find all such functions $f(x)$.
a) Let's write the given equality for $x=0$ and $x=1$: $f(x) + \frac{1}{2} f(1) = 1$, $f(1) + \frac{3}{2} f(0) = 1$. Solving this system, we get $f(0) = 2$, $f(1) = -2$.

b) Let's write the given equality for $x = \frac{1}{2} + t$ and $x = \frac{1}{2} - t$: $f\left(\frac{1}{2} - t\right) + (1 - t) f\left(\frac{1}{2} + t\right) = 1$, $f\left(\frac{1}{2} + t\right) + (1 + t) f\left(\frac{1}{2} - t\right) = 1$. For $t \neq 0$, this system has a unique solution $f\left(\frac{1}{2} + t\right) = -\frac{1}{t}$, $f\left(\frac{1}{2} - t\right) = \frac{1}{t}$. Therefore, $f(x) = \frac{2}{1 - 2x}$ for $x \neq \frac{1}{2}$.

Now, let's write the given equality for $x = \frac{1}{2}$: $f\left(\frac{1}{2}\right) + \left(\frac{1}{2} + \frac{1}{2}\right) f\left(\frac{1}{2}\right) = 1$, that is, $f\left(\frac{1}{2}\right) = \frac{1}{2}$. Verification that this function fits is done by direct substitution.

## Answer

$f(x) = \frac{2}{1 - 2x}$ for $x \neq \frac{1}{2}$, $f\left(\frac{1}{2}\right) = \frac{1}{2}$.