Let $a,b,p \in \mathbb{N}$ such that $a\mid b$ and $b\mid (ap)$ where $p$ is prime. Show that $b=a$ or $b=ap$
So far I know that $b=a(x)$ and $(ap)=b(y)$ where $x,y \in \mathbb{Z}$. Also fro that you can conclude that $a \mid (ap)$ so $ap=a(z)=b(y)$ where $z \in \mathbb{Z}$. Now I don't really see the next steps to use or where the idea that $p$ is prime comes into play. I only have the definition of divide and prime right now also to use.
Hint $\,\ b/a\mid p\,\Rightarrow\,\underbrace{ b/a = 1}_{\large b\ =\ a}\,$ or $\ \underbrace{b/a = p}_{\large b\ =\ ap}$