Learn about domain, co-domain, range, image and pre-image, then practice solving.
In the function f: A → B, set A is called the Domain, and set B is called the Co-domain. Similarly, the set of members of set B that are related to the members of set A is called the Range. The members of set B that are associated with set A are called the Image of f, and the corresponding member of A is called the Pre-image.
For example: If set A = {1, 2, 3}, set B = {2, 3, 4, 5} and f = {(1, 2), (2, 3), (3, 4)} then:
Domain of function f = {1, 2, 3}
Co-domain of function f = {2, 3, 4, 5}
Range of function f = {2, 3, 4}
Hence, range of a function is always a subset of the co-domain.
The image of 1 is 2, or the pre-image of 2 is 1. This is written as f(1) = 2. Similarly, f(2) = 3, f(3) = 4.
A = {1, 2, 3}, B = {2, 3, 4, 5}
5 has no pre-image, so it isn't in the range — range = {2, 3, 4} ⊆ co-domain = {2, 3, 4, 5}.