Let $f$ and $g$ be defined in $\mathbb R$ and suppose that exists $M>0$ such that
$$|f(x)-f(p)|\leqslant M|g(x)-g(p)|, \quad \text{ for every } x.$$
Prove that if $g$ is continuous at $p$, then $f$ is also continuous at $p$.
I understand the overall idea of what should be done in this problem, but I don't understand the step below.
$$ |x-p|<\delta \implies |g(x)-g(p)|< \epsilon/M $$
In my thought process, if $g$ is continuous at $p$, then $|g(x)-g(p)|<\epsilon$ and, since $M>0$, $M|g(x)-g(p)|<M\epsilon$. I don't understand how one could just assume that $|g(x)-g(p)|<\epsilon/M$.
Since $g$ is supposed to be continuous at $p$, $$\forall \epsilon > 0, \exists \delta > 0, \ \forall x \in \mathbb R, |x - p| < \delta \implies |g(x) - g(p)| < \epsilon.$$ I think you got that. It means that you can take whatever $\epsilon$ you want and get a $\delta$ for that $\epsilon$. So it is perfectly correct to take $\epsilon/M$ (replace $\epsilon$ by $\eta$ in the definition of continuity and set $\eta := \epsilon/M$.
I guess the proof your looking at took $\epsilon/M$ so that it matches the definition of continuity at $p$ that we want $f$ to verify. So that the constants cancel well. With more practice, you'll see that exactly matching the constants doesn't really matter.