As explained in the comments, smoothness is guaranteed by the definition of submanifold. The concern that "the manifold structures might not be compatible" is reasonable, but submanifolds are defined so that compatibility holds. Here is a non-example: let $M$ be the curve $y=|x|$ in the plane, considered as the image of $\mathbb R$ under $f(x) = (x,|x|)$. We can make $M$ a smooth manifold by declaring $f$ a diffeomorphism. Now $f:\mathbb R\to M$ is smooth but $f:\mathbb R\to\mathbb R^2$ is not; the smooth structures are not compatible. But of course, $M$ is not a submanifold of $\mathbb R^2$ here.
The definition you have (which is the definition of an immersed submanifold) has the smoothness of the inclusion map built in.