Let $f,g:[0,1] \rightarrow \Bbb R$ be continuous such that $\int_0^1 f(x)\,dx=\int_0^1 g(x)\,dx=1$. Let $n \in \Bbb N$. I want to prove that there exists $[a,b] \subset [0,1]$ such that $\int_a^b f(x)\,dx=\int_a^b g(x)\,dx=\frac{ 1}n$.
I tried everything I can for a few hours but couldn't get anything. could somone please help on this? We can use everything involving 1-variable real analysis - including results from topology if needed.