Assume $f :[0,1] \rightarrow [0,1]$ is a continuous function. Show there exists a fixed point $x$, i.e. $f(x) = x$ Assume $f :[0,1] \rightarrow [0,1]$ is a continuous function. 

Show there is $x \in [0,1]$ with $f(x) = x.$

Is there an example of a continuous function $g:(0,1) \rightarrow (0,1)$ where this is false?
 A: Let $h(x)=f(x)-x$.
$$h(0)=f(0)-0=f(0)\ge0$$
$$h(1)=f(1)-1\le0$$
By the intermediate value theorem,
$$h(x)=0\Rightarrow f(x)=x$$
for some $x\in[0,1]$.
This is not true in $(0,1)$. For example, consider $g(x)=x^2\lt x$ for all $x\in(0,1)$.
A: $f(x)=x+x(1-x)$ for example
$f(x)$ is always greater then $x$ in $(0,1)$ but still doesn't leave the interval
A: A demonstration without the intermediate value theorem.
If $f(0)\neq 0$ and $f(1)\neq 1$ then $f(0)-0>0$ and $f(1)-1<0$. Let $I_{n}=\{0=\frac{0}{n},\frac{1}{n},\frac{2}{n},\ldots, \frac{n-1}{n}, \frac{n}{n}=1\}$. For all $n$ set $k_n\in\{0,1,\ldots,n\}$ such that
$$  
\begin{array}{cc}
f\left(\frac{0}{n}\right)-\frac{0}{n}&\geq 0. 
\\
f\left(\frac{1}{n}\right)-\frac{1}{n}&\geq 0.
\\
\vdots & 
\\
f\left(\frac{k_n-1}{n}\right)-\frac{k_n-1}{n}&\geq 0. 
\\
f\left(\frac{k_n}{n}\right)-\frac{k_n}{n}&\geq 0. 
\\
f\left(\frac{k_n+1}{n}\right)-\frac{k_n+1}{n}&\leq 0. 
\end{array}
$$
Set $u_n=\frac{k_n}{n}$ and $v_n=u_n+\frac{1}{n}$. The sequences $u_n$ and $v_n$ are limited. By weierstrass theorem there is a convergent subsequence $u_{n_i}$ such that $\lim_{i\to \infty} u_{n_i}=u\in [0,1]$ and $\lim_{i\to \infty} v_{n_i}=v\in [0,1]$. By the continuity of $f$ we have $\lim_{i\to \infty}f(u_i)-u_i=f(u)-u\geq 0$ and $\lim_{i\to \infty}f(v_i)-v_i=f(v)-v\leq 0$. 
Now note that $|u_{n_i}-v_{n_i}|=1/n$ implies $f(u)-u=\lim_{i\to \infty}f(u_i)-u_i= \lim_{i\to \infty}f(v_i)-v_i=f(v)-v $. By $0\leq f(u)-u=f(v)-v\leq 0$  we can only conclude $f(u)-u=0$, i.e.
$$
f(u)=u
$$
Counter example. For $0<x<1$ we have $0<x^n<x$ for all $n\geq 2$. Then $f:(0,1)\to (0,1)$ definite by $f(x)=x^n$ is such that $f(x)<x$.  
