Not sure how to best phrase the question, so I'll simply use a problem I solved that slightly confused me. I need to prove the following claim:
Claim. Let $1 \le p < \infty$ and $f \in L^p(\mathbb{R}, \mathcal{L}, \mu)$ where $\mu$ is the Lebesgue measure. For $h>0$ define $f_h(x) = \frac{1}{h} \int_{x}^{x+h}f(t)\ dt$. Prove that $\lVert f_h - f \rVert_p \to 0$ as $h \to 0$.
Proof. Let $\varepsilon > 0$. Since $C_K(\mathbb{R})$ (continuous functions with compact support) is dense in $L^p$, let $g \in C_K(\mathbb{R})$ such that $\|f - g\|_p < \frac{\varepsilon}{3}$ and $g = 0$ on $\mathbb{R} \setminus K$ where $K$ is compact. We have \begin{equation} \|f_h - f\|_p \leq \|f_h - g_h\|_p + \|g_h - g\|_p + \|g - f\|_p \end{equation} where $g_h(x) = \frac{1}{h}\int_x^{x+h} g(t) \, dt$.
Observe that $f_h(x) - g_h(x) = \int_x^{x+h} (f(t) - g(t)) \, dt = (f - g)_h(x)$. Since $\| f_h \|_p \le \| f \|_p$ (I have proven this in a previous problem), thus $\|f_h - g_h\|_p \leq \|f - g\|_p < \frac{\varepsilon}{3}$.
Let $K \subset [a, b]$ for some $a < b$. Note that $g$ is uniformly continuous on $[a-1, b+1]$, so suppose \begin{equation} |g(x) - g(t)| < \frac{\varepsilon}{3 (b-a+1)^{1/p}} \end{equation} whenever $|x - t| < \delta$ for all $x, t \in [a-1, b+1]$. Accordingly, let $h < \min\{\delta, 1\}$.
Since $g = 0$ on $\mathbb{R} \setminus [a, b]$, observe that $h < 1$ implies $g_h$ is $0$ on $\mathbb{R} \setminus [a-1, b]$. Thus, \begin{align*} \|g_h - g\|_p^p &= \int_{a-1}^{b} \left| g_h(x) - g(x) \right|^p \, dx \\ &= \int_{a-1}^{b} \left| \frac{1}{h} \int_x^{x+h} (g(t) - g(x)) \, dt \right|^p dx \\ &\leq \int_{a-1}^{b} \frac{1}{h^p} \left( \int_x^{x+h} |g(t) - g(x)| \, dt \right)^p dx \\ &\leq \int_{a-1}^{b} \frac{1}{h^p} \left( \int_x^{x+h} \frac{\varepsilon}{3 (b-a+1)^{1/p}} \, dt \right)^p dx \\ &= \int_{a-1}^{b} \frac{1}{h^p} \left( \frac{\varepsilon}{3 (b-a+1)^{1/p}} \cdot h \right)^p dx \\ &= \int_{a-1}^{b} \frac{1}{h^p} \cdot \frac{\varepsilon^p}{3^p (b-a+1)} \cdot h^p dx \\ &= \frac{\varepsilon^p}{3^p (b-a+1)} \cdot \int_{a-1}^{b} \, dx \\ &= \frac{\varepsilon^p}{3^p}. \end{align*}
Taking the $p$-th root, we get $\|g_h - g\|_p \le \frac{\epsilon}{3}$ which completes the proof. $\Box$
Now, in initially doing this proof, I originally did:
Suppose $|g(x) - g(t)| < \epsilon$ whenever $|x - t| < \delta$ for all $x, t \in [a-1, b+1]$. This made it so my bound on $\|g_h - g \|_p$ and thus $\|f_h - f \|_p$ depends on $(b-a+1)$ which depends on $\epsilon$ (since $g$ and thus $K$ themselves depend on the $\epsilon$). Just looking at it as: $\|f_h - f \|_p < \epsilon(b-a+1)$ makes me think it's wrong since the $b-a+1$ depends on $\epsilon$, so we do not know if the whole expression goes to $0$ as $\epsilon \to 0$, but if we adjust the uniform continuity bound, this term cancels.
This doesn't feel completely intuitive to me and almost like I'm missing something, but I'm not even sure how to best ask this. It's almost like, I am not fully sure when bounding things if it's allowed for constants to be dependent on $\epsilon$, it seems more nuanced than this, and I would like to have a better approach of what exactly can and cannot depend on $\epsilon$. My current approach is if I can fix the bounds such that everything in the end simplifies nicely to $\epsilon$ then clearly we are fine, but as problems get more complex, it would be nice to be able to have more messy $\epsilon$ bounds containing constants and be able to just say: letting $\epsilon \to 0$ we achieve what we want.
Edit. Compare this to the following: We want to show $\lim_{x \to 0} |f(x)| = 0$. Let $\epsilon > 0$. Let $N(\epsilon)$ be some constant dependent on $\epsilon$. Now, suppose we know for some $\delta(N, \epsilon)$ we have $|f(x)| < N\epsilon$ whenever $|x| < \delta$. In this case it's clear that this is not enough since $\epsilon N(\epsilon)$ may not go to $0$. What makes this different than the prior $L^p$ problem where even if we have the bound depending on some constant($\epsilon$) it so happened to work out nicely in that case? Is there a better way of thinking of the original $L^p$ problem that makes it clear why having the expression $< (b-a+1)$ would still be fine?