Is the image of a function the codomain of a function? Here is a definition from the functions section in my discrete math textbook (Discrete Mathematics and its Applications 7e, Rosen 2012):


  Let $f$ be a function from $A$ to $B$, and let $S$ be a subset of $A$. The image
  of S under the function $f$ is the subset of $B$ that consists of the
  images of the elements of $S$. We denote the image of $S$ by $f(S)$, so:
  
  $f(S) = \{t \mid \exists s \in S (t = f(s)) \}.$
  
  We also use the shorthand $\{ f(s) \mid s \in S \}$ to denote this set.


So I guess I am just a little confused with the idea of an image. Is it the same as the codomain? And where it says, "The image of $S$ under the function ...".  What do you think it means by "under"?  Some examples would be great.
The image is the subset of the co-domain that the domain actually maps to. Take for instance the following function $$f: \mathbb{N} \rightarrow \mathbb{N}, \quad f(x) = 5.$$

It is simply the constant function that always "returns" 5, no matter what natural number is "passed in." The domain/co-domain defining $f$ is fine, but observe that the only value in the co-domain ever "used" is 5. In this case, the image of $f$ would just be the set $\{5\}.$

"The image of $S$ under $f$" is an explicit reference to the image of $f$ given $S$. That is to say, it is whatever each element in $S$ maps to as defined by $f$.