How can I find the domain and the range of a function?

I'm working on a task which has the following question:

What is the domain and the range to the function g?

Here is the function g:

Let A - $\{$1, 2, 3, 4$\}$, B - $\{$a, b, c, d$\}$

• Let g : B $\rightarrow$ A be defined so that g - $\{$$\lta, 1\gt,\ltb, 2\gt, \ltc, 4\gt, \ltd, 4\gt$$\}$

Since the question is asking for the domain to the function g and since B is the domain to the function g and A is the codomain to the function g, would the answer; B - {a, b, c, d} is the domain, hold as a correct answer? Or would I have to add something more to it?

Also how can I find the range of the function g?

Would appreciate some help, thanks alot!

The domain here is $B=\{a,b,c,d\}$ as it's the set of elements which you feed in to the function. The range of $g$ is the set of elements hit by $g$ which is a subset of the codomain (which in this example is $A$), and so the range of $g$ is $\{1,2,4\}$ because there does not exist any element $x$ in $B$ such that $g(x)=3$.
In your notation, the last sentence would read "because there does not exist any element $x$ in $B$ such that $\langle x,3\rangle \in g$".