$f:[0;1]\to \mathbb{R}$ is continuous and

${\int}_{0}^{1}\text{}f(x)dx=\frac{1}{2}$

Proof that there exists an $c\in [0,1]$ such that $f(c)=c$.

Idea: So i would define a function $g(x)=f(x)-x$ and then find points so that $g(x)$ would be $g(y)<0$ and $g(z)>0$. And proceed with my proof and use the intermediate value theorem.

However, i am confused how to do that since i don't have the exact function but only the integral.

Can i just define an $f(x)$ for which the integral would work like $f(x)=\frac{1}{2}$?

${\int}_{0}^{1}\text{}f(x)dx=\frac{1}{2}$

Proof that there exists an $c\in [0,1]$ such that $f(c)=c$.

Idea: So i would define a function $g(x)=f(x)-x$ and then find points so that $g(x)$ would be $g(y)<0$ and $g(z)>0$. And proceed with my proof and use the intermediate value theorem.

However, i am confused how to do that since i don't have the exact function but only the integral.

Can i just define an $f(x)$ for which the integral would work like $f(x)=\frac{1}{2}$?