I was trying to prove that a continuous function $f:[a,b]\to\Bbb{R}$ is integrable and thought that I came up with an easy solution so I checked the internet and here is a long proof: <https://proofwiki.org/wiki/Continuous_Function_is_Riemann_Integrable>. This makes me think that something is wrong with my argument:

We know that $f$ attains its maximum and minimum on $[a,b]$, call them $A$ and $B$ resp. Assume that $f$ is not constant so that $A\not=B$ (when $f$ is constant it is trivial to prove that $f$ is integrable). Let $\epsilon>0$. It suffices to find a partition such that $U(P)-L(P)<\epsilon$. This is true for a partition with mesh $<\epsilon/(A-B)$. Isn't it?
['https://math.stackexchange.com/questions/822920', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/155603/']
No, this proof is not correct - there's not a nice connection between the size of the mesh and the difference in $y$-values. Let's look at a specific function, $y = \sqrt x$, on the interval $[0,1]$. Choose $\epsilon = .1$, so the proposed mesh size is $0.1$. 

Looking at the interval partitioned as $[0, .1] \cup [.1, .2] \cup ... \cup [.9, 1]$, we have that the difference between the partitions is *at least* $\sqrt{.1} > .1$ - just look at the very first piece of the partition.
Use the fact that a continuous function on a closed interval is uniformly continuous to find $\delta$ such that 
$$|x-y| \leq \delta \rightarrow |f(x)-f(y)| \leq \frac{\epsilon}{b-a}$$ then $\delta$ is the size of the mesh.