Prove that $f:[0,1] \to [0,1]$ has a fixed point 
Let $f:[0,1] \to [0,1]$ such that $f$ has lateral limits at any point, is continuous at $0$ and $1$ and $$\lim_{t\nearrow x}f(t) \leq f(x) \leq \lim_{t \searrow x}f(t), \forall x \in (0,1)$$
  Prove that $f$ has at least one fixed point.

I built $A=\{x \in [0,1] \mid f(x) \geq x \}$ and $B=\{x\in [0,1] \mid f(x) \leq x \}$ and tried to prove that $A \cap B \neq \emptyset$. Because $0 \in A$ and $1 \in B$, the sets are not empty and I considered $\alpha = \sup A$ and $\beta = \inf B$. Then I supposed that $\alpha \in A$ or $\beta \in B$ (they can be treated the same).
Suppose $\alpha \in A$. If $\alpha=1$, the problem is solved. Otherwise, because $\alpha=\sup A$, we also know that $\forall 0<\epsilon<1-\alpha$, we have $ \alpha+\epsilon \in B$. So $\alpha+\epsilon \geq f(\alpha +\epsilon)$. Now I tried to use the inequality in the problem's statement to get $f(\alpha+\epsilon) \geq f(\alpha) \geq \alpha$ and then make $\epsilon \to 0$ so that $f(\alpha)=\alpha$, but I didn't manage to do these.
If $\alpha \notin A$ and $\beta \notin A$, I don't even know what to do. I'm also confused because of the condition that $f$ is continuous at $0$ and $1$. I don't see how this helps at all.
 A: Assume $f(0)>0,f(1)<1$ otherwise there is nothing to prove. Let $$A=\{x\mid x\in[0,1],f(x)>x\} $$ and $s=\sup A$. Then by continuity of $f$ at $0,1$ we have $s\in(0,1)$.
Now we can prove that $f(s) =s$. If $f(s) < s$ then $f(s-0)\leq f(s) <s$. Then we have a number $h>0$ such that $f(x) < x$ for all $x\in(s-h, s]$. But by definition of supremum we have a member $a\in A$ such that $s-h<a\leq s$ and then $f(a) >a$. This is a contradiction. Similar contradiction is achieved if $f(s) >s$. 
A: You already have $f(\alpha+\epsilon)\le \alpha+\epsilon$ for all sufficiently small positive $\epsilon$, so 
$$f(\alpha)\le \lim_{\epsilon\to 0^+}f(\alpha+\epsilon)\le \lim_{\epsilon\to 0^+}(\alpha+\epsilon)=\alpha $$
and so $\alpha\in B$.
The final case, $\alpha\notin A$, $\beta\notin B$, cannot occur. In fact, we can show $\alpha\in A$ (and likewise $\beta\in B$):
If $\alpha\notin A$, then there exists a sequence $x_n\to \alpha^-$ with $x_n\in A$, so
$$f(\alpha)\ge\lim_{x\to\alpha^-}f(x)\ge \lim_{n\to\infty}f(x_n)\ge   \lim_{n\to\infty}x_n=\alpha.$$
So if you clean up the above arguments, you do not even really need $B$ because we apparently can show $\sup A\ge f(\sup A)\ge\sup A$ without it.
A: Simple trick:
Let $h(x) = f(x) - x$.  $h(0) = f(0) \ge 0$ and $h(1) = f(1)- 1 \le 0$.
If $f(0) = 0$ that is a fixed point and if $f(1) = 1$ that is a fixed point.
Other wise we have $h(0) > 0 > h(1)$.
If $f$ were continuous we'd have the Intermediate Value Theorem telling us there is point $x \in (0,1)$ so that $h(x) = 0$ and so $f(x) = x$.
But $f$ might not be continuous.
Okay.  $h(0) > 0$ and $h(1) < 1$ so there must be some "first point" of $x$ where $x \le 0$.  i.e. let $a = \sup\{x|\forall y\in [0,x]; h(y)\ge 0\}$
So $\lim_{x\nearrow a} h(x) \ge 0$.
For all $y > a$ there is some $w; a < w < y$ so that $h(w)< 0$.  So $\lim_{x\searrow a}h(x) \le 0$.
But $\lim_{x\nearrow a} h(x) = \lim_{x\nearrow a} f(x) - a \le f(a) - a \le \lim_{x\searrow a}f(x) - a=\lim_{x\searrow a} h(x)$.
So we have $\lim_{x\nearrow a} h(x) \ge 0$ and $\lim_{x\searrow a} h(x) \le 0$, but $\lim_{x\nearrow a} h(x) \le\lim_{x\searrow a} h(x)$.
So  $\lim_{x\nearrow a} h(x)  = \lim_{x\searrow a} h(x)= 0 = f(a) - a$.
And $f(a) = a$.
