Suppose that f is integrable on $[a,b]$. Prove there is a number $x$ in $[a,b]$ such that $\int_a^x f = \int_x^b f$ Also, show by example that it is not always possible to choose $x$ in $(a,b)$
I've proven the first part (in the title), but I can't seem to think of a scenario for the second part.  Perhaps my brain is a bit fuzzy at this point in the night, so I apologize in advance if this is an obvious answer, but any help would be appreciated.
 A: We can get a hint towards a solution to the question, given a proof of the titular claim. To see this, we'll provide a proof.
Define a function $g:[a,b]\to\mathbf{R}$ by $$g(x) = \int_a^x\!f - \int_x^b\!f$$
and note that the problem is solved if we can find a root of $g$ in $[a, b]$.
But $g(b) = \int_a^b\!f = -g(a)$ so that if $\int_a^b\!f\ne0$ then $g$ has a root $x$ in $(a, b)$ by IVT. And if $\int_a^b\!f = 0$ then both $x = a$ and $x = b$ work.
From the proof, we see that if we cannot choose $x$ in $(a, b)$ then our counterexample must have zero area along $[a, b]$.  Now, we know odd functions have zero area; in this case, functions symmetric about $\frac{a+b}{2}$ will have zero area. Thus we can look for an $f$ with the property that $f(a+b-x) = -f(x)$. 
The simplest such function is $f(x) = x - \frac{a+b}{2}$, whose integral from $a$ to $x$ is $\frac{1}{2}(x-a)(x-b)$ and whose integral from $x$ to $b$ is the negative of that. This is the counterexample we seek, because for every $x$ in the interval $(a, b)$, the number $x - a$ is positive while the number $x-b$ is negative, making $\int_a^x\!f$ negative and hence distinct from $\int_x^b\!f$ (because the latter quantity is positive).
A: Consider $$F(x)=\int\limits_{a}^{x}f. \tag{1}$$ The problem is reduced to show existence of $x\in [a,b]$ such that $$F(x) = \frac{1}{2} F(b). \tag{2}$$ Since $f\in \mathscr{R}$ on $[a,b]$, $F$ is continuous over $[a,b]$. Notice that $F(a)=0$. We split the problem into three cases according to the value of $F(b)$.


*

*If $F(b)>0$, then $F(a)<\frac{1}{2}F(b)<F(b)$.

*If $F(b)<0$, then $F(b)<\frac{1}{2}F(b)<F(a)$.

*When $F(b)=0$, $x=a$ or $b$ will do.


In the first two cases, use Intermediate value theorem for continuous functions to show existence of $x\in (a,b)$ satisfying $(2)$ . 
To answer your second question, we need to find an example where case $3$ happens. One such example is $f(x)=\sin x $ over $[0,2\pi]$.
