Bounding a function on sets with a prescribed measure In the proof of a lemma in a paper I'm reading the following is claimed.

Let $f$ be a measurable function with $f(t) \geq 0$ for $0 \leq t \leq 1$ and $\int_0^1 f(t)\,dt = 1$.  Let $k$ be a fixed number with $0 \leq k < 1$.  Then we can find an $E \subseteq [0,1]$ with Lebesgue measure $\mu(E) = k$ and a number $p$ such that $$f(t) \leq p \,\text{ for }\, t \in E \,\text{ and }\, f(t) \geq p \,\text{ for }\, t \notin E.$$

Why can we always find such $E$ and $p$ at the same time?

The paper is:
De Bruijn, N. G.
On some Volterra integral equations of which all solutions are convergent.
Nederl. Akad. Wetensch., Proc. 53, (1950) 813–821 = Indagationes Math. 12, 257–265 (1950).
I've paraphrased it slightly but the statement is essentially the first claim in the proof of Lemma 2.
 A: For $k<1$, I think it is true:
Let $g(x)=\mu (f^{-1}([0,x)))$. Then $g$ is an increasing function because if $x<y$ then $f^{-1}([0,x) ) \subset f^{-1}([0,y) )$. This has only countably many discontinuities and they are all jump discontinuities. 
If $g(x)=k$, then $x=p$ and $E=f^{-1}([0,p))$. 
Suppose $g$ jumps over the value $k$. That is, $\lim_{x\to p^-} g(x)<k$  $\lim_{x\to p^+} g(x)>k$. Suppose $g(p)<k$. Then $\lim_{x\to p^+} g(x)>k$ tells us that $\mu (f^{-1}(\{p\}))>0.$ Find a subset $A$ of $f^{-1}(\{p\})$ with measure $k-g(p)$. Then $E=A\cup f^{-1}([0,p))$. Similarly for $g(p)>k$.
Note that the integral condition guarantees that $f$ is bounded almost everywhere so these inverse images get a set of full measure.
A: I don't think the statement is true: Choose a function $f: [0,1]\to (0,\infty)$ such that $f$ is continuous in $(0,1)$, $\lim_{t\to 0} f(t)=\infty$ and $\int_0^1 f(t)dt=1$.
Take $k=1$ and suppose that there exist $E$ with $|E|=1$ and $p>0$ such that $$f(t)\leq p,\ \forall\ t\in E \tag{1}$$
From $(1)$, $\lim_{t\to 0} f(t)=\infty$ and the continuity, we conclude that there exist $\delta>0$ such that $E\subset (\delta,1)$, which is N absurd, because $|E|=1$. 
