What is meant by a smooth structure with respect to a function? Suppose $M$ is a smooth manifold. Up until now (which I learned from Lee's book Introduction to Smooth Manifolds) I have taken a smooth structure on $M$ to be a maximal smooth atlas. That is, a collection of charts $\{(U_\alpha, \phi_\alpha)\}$ such that the transition maps $\phi_\alpha \circ \phi_\beta^{-1}$ is smooth for all $\alpha$ and $\beta$, and also such that this collection of charts is contained in no other collection.
However, further along in the book he mentions smooth structures with respect to certain functions. For example, in the section regarding immersed submanifolds, Lee says

An immersed submanifold $M$ is a subset $S \subset M$ endowed with a topology with respect to which it is a topological manifold, and a smooth structure with respect to which the inclusion map $S \hookrightarrow M$ is a smooth immersion.

I am having trouble understanding what is meant by the last half of the above definition. How do we have a smooth structure with respect to a function? If we denote the inclusion map by $i$, does this amount to requiring $\phi \circ i \circ \psi^{-1}$ be smooth where $\phi$ belongs to some chart in $M$ and $\psi$ belongs to some chart in $S$?
 A: 
How do we have a smooth structure with respect to a function?

It's the other way around; $S$ is endowed with a smooth structure (so that is is a smooth manifold in and of itself) and with respect to this smooth structure the inclusion map (which is a priori a continuous map) $\iota: S\to M, s\mapsto s$ is a smooth function. The point is that there are subtleties regarding what a "submanifold" ought to mean, and in this case an immersed smooth submanifold need not inherit a smooth structure from the ambient manifold (globally speaking). The standard example is a line with irrational slope in $2$-torus, see my answer at Dynamics on the torus.
The general theme is that because there are subtleties with the definition of a submanifold as a "subset of a manifold which is a manifold in and of itself", one emphasizes the parameterization of the submanifold.

If we denote the inclusion map by $i$, does this amount to requiring $\phi \circ i \circ \psi^{-1}$ be smooth where $\phi$ belongs to some chart in $M$ and $\psi$ belongs to some chart in $S$?

Yes, but what makes the definition confusing is that $\psi$ need not be related to $\phi$ in general. In the case of the irrational line immersed in the torus, $\psi$ takes a one-dimensional open subset to an open interval, whereas $\phi\circ \iota$ will have the image of an open subset densely foliated by line segments (because the irrational line (as a topological subspace) is dense in the torus).
It might be a useful exercise to compare and contrast a comparison between

*

*"topological subspace",

*"(injectively) immersed smooth submanifold",

*"embedded smooth submanifold",

*"properly embedded smooth submanifold",

*"embedded topological submanifold", and

*"properly embedded topological submanifold";

all these phrases are defined in the book you are citing.
