# Set theory function

I am trying to solve the following question.

Let $f:A \to B$ and $g:A \to B$ be functions. Prove that if $f \subset g$, then $f=g$.

Here is my attempt.

Assume that $f \subset g$. Then, if $(x,y) \in f$, then $(x,y) \in g$. What we have to show is that for every ordered pair $(x,y) \in f$, it is also in $g$ as well and vice versa. and... I'm stuck here. Can anyone give me some help?

Suppose $(x,y) \in g$. As $f$ is a function, there exists some $(x,y') \in f$. This $(x,y') \in g$ by $f \subset g$. So $(x,y') , (x,y) \in g$ and as $g$ is a function: $y =y'$ and so $(x,y) = (x,y') \in f$ so $g \subset f$ and you have equality.
Hint: Assume there is a pair $(x, y)\in g$ with $(x, y)\notin f$. Then is $f$ a function form $A$ to $B$?
• For $f$ to be a function every element $x \in A$ has an image $y \in B$. But does this assumption make $f$ not a function? – Cruso James Apr 17 '17 at 9:24
The clue is that both functions have the same domain $A$. $f \subset g$ implies $f = g$ throughout $f$'s domain.