if $F$ is defined as $\int_0^x f$, why isn't awalys true that $F'(x) = f(x)$? for example, $f(x) = 0$ if $x \leq 1, f(x) = 1$ if $x>1$.
at which point $x$ is $F'(x) = f(x)$ ?
The correct answer is All $x \ne 1$.
But since  $F'(x) = \frac{d}{dx}\int_0^x f(t) dt = f(x)$, when $x =1$, $f(1) = 0$, and $F'(1) = 0$ as well.
I'm confused that why isn't $F'(x) = f(x)$ since that how we define $F$. 
Also, the same question finding which point $x$ is $F'(x) = f(x)$  for 
(1) $f(x) = 0$ if $x$ is irrational, $f(x) = 1/p$ if $x=q/p$ in lowest term.
(2) $f(x) = 1$ if $x \leq 0$ or $x > 1$, $f(x) = 1/[1/x]$ if $0<x\leq 1$
I don't know how to approach it either, since I definitely misunderstand the definition afterall. 
 A: The fundamental theorem of calculus (in the usual form stated for undergraduates) requires that $f$ is continuous. That is, if $f:[a,b] \to \mathbb{R}$ is continuous, and $F(x) := \int_a^x f(t)dt$, then $F'(x) = f(x)$.
If you are working with an $f$ that is not continuous, you have no guarantee that the fundamental theorem of calculus applies, and hence no reason to suspect that $F'(x)=f(x)$.
In your questions you have to more carefully use the definition of derivative.
I'll give you a hint:
(1) $F(x) = 0$ for all $x$, and hence $F'(x) =0$ for all $x$, so $F'(x)=f(x)$ for irrational $x$ only. 
Can you solve (2) with a similar method?
A: It's not true that $\frac{d}{dx}\int_0^x f(t)dt=f(x)$ always (also, that's exactly what you want to prove, so you can't use it in your proof!)
In your first example, $F$ is not differentiable at $x=1$. $F$ is only differentiable at $x$ when $f$ is continous at $x$. What is true is that, whenever $f$ is continous at $x$, $F$ will be differentiable at $x$, and the formula $F'(x)=f(x)$ will hold.
As for the last two examples, you need to find the points at which $f$ is continous. For (1), $f$ is continous at the irrationals (since any sequence of rationals $p/q$ that converge to an irrational must satisfy $q\to\infty$, because given any $N$, there are only finitely many rationals $p/q$ in any bounded interval with $q<N$). You can show that $F(x)=0$ for every $x$ in this case. This means that $F$ will be everywhere differentiable, but again, the formula $F'(x)=f(x)$ will hold only at points in which $f$ is continous.
For (2), draw the graph of $f$ to show that $f$ is continous at every point, except $x=0$. As discussed in the comments below, since $f$ has limits $\lim_{x\to 0^-} f(x) \neq \lim_{x\to 0^+} f(x)$, these limits will be the lateral derivatives of $F$, and then $F$ won't be differentiable at $0$.
