why do I need to apply the theorem to $f=\chi_{F^c}$? 
I want to show that 
  $$\lim_{r\to 0} \frac{m(F\cap B(r,x))}{m(B(r,x))}=1 \text{ for a.e. } x\in F \text{ and } =0 \text{ for a.e. } x\in F^c$$

My solution: I let $f=\chi_{F}$ and by Lebesgue differentiation theorem I can get the limit is 1 for a.e. $x\in F$ and $x\in F^c$. But why do I need to apply the theorem to $f=\chi_{F^c}$? And could you give an example for some $x$ and $F$, the above limit does not exist?
I feel like that apply LDT to $\chi_{F^c}$ and note that
$$m(F^c\cap B(x,r))=m((X-F)\cap B(x,r))=m(X\cap B(x,r))-m(F\cap B(x,r))$$
So $$1-\lim_{r\to 0} \frac{m(F\cap B(r,x))}{m(B(r,x))}=\lim_{r\to 0} \frac{m(F^c\cap B(r,x))}{m(B(r,x))}=1$$
for a.e. $x\in F^c$, that is,
$$\lim_{r\to 0} \frac{m(F\cap B(r,x))}{m(B(r,x))}=0$$
 A: It's just a matter of applying the theorem to the characteristic function on $F$, because the theorem states that if $f:\mathbb R^n\to \mathbb R$ is locally integrable then $\underset{r \rightarrow 0}\lim\frac{1}{m(B_r(x))} \int_{B_r(x)} f(y) m(dy) = f(x)$ for almost all $x\in F.$ So, taking $f=\chi_F,\ x\in F$ we have 
$\underset{r \rightarrow 0}\lim\frac{1}{m(B_r(x))} \int_{B_r(x)} f(y) m(dy) = \underset{r \rightarrow 0}\lim\frac{1}{m(B_r(x))} \int_{B_r(x)} \chi_F(y) m(dy) =  \underset{r \rightarrow 0}\lim\frac{m(F)\cap B_r(x)}{m(B_r(x))}=\chi_F(x)=1.$
And if $x\notin F$, the same calculation shows that this limit is zero.
For example, if $F$ is a square in $\mathbb R^2$ then you can calculate directly that the limit is $1$ for interior points, $1/4$ for the corners and $1/2$ on the open edges, i.e. the set (the boundary) on which this limit is $\textit{not}$ equal to $1$ has Lebesgue measure zero. 
For an example of failure of this theorem, see Stein's book Harmonic Analysis: Real-Variable Methods, Orthogonality, and Oscillatory Integrals. 
