Equality of functions and Sets of functions I wondered about the following, perhaps somewhat philosophical question. $(1)$ Let $f: A \to B$ be a function with $B \subseteq C$. Is $f \in \{g \ | \ g: A \to C\}$?
$(2)$ Consider the set of all continuous functions from $A \to B \times C, \ \mathcal{M}:=\{f: A \to B \times C \ | \ f \ \mathrm{continuous}\}$ and let $A,B,C$ be topological spaces for this to make sense. Furthermore let $d_A:A \to A \times A, \ a \mapsto (a,a)$ be the diagonal map and $$\mathcal{N}:=\{((\pi_B \circ f) \times (\pi_C \circ f)) \circ d_A \ | \ \pi_X:X \times Y \to X \ \mathrm{projection \ for \ all} \ X, f: A \to B \times C \ \mathrm{continuous}\}.$$
Is it true that $\mathcal{M}=\mathcal{N}$?
My thoughts (Please correct me if I am wrong): $(1)$ As far as I know, two functions $f:X \to Y, g:A \to B$ are equal iff $X=A$ and for all $x \in X$ $f(x)=g(x)$. Therefore, $f$ is the same object (function) as $\tilde{f}:A \to C, a \mapsto f(a)$ and thus $f$ is in the set. The conclusion that this is in the set comes from the way I (hopefully correctly) read the set: It contains all the functions $g$ such that $g:A \to C$ and since $f$ is equal the same function as $\tilde{f}$, it is in the set.
$(2)$ This is essentially the same. The set $\mathcal{M}$ is to be read as the set of all the functions $f:A \to B$ such that $f$ is continuous. Since all Functions that are in $\mathcal{N}$ are continuous, it should hold that this is a subset of $\mathcal{M}$. For the other inclusion: since every continuous function of $\mathcal{M}$ can be written as a function of $\mathcal{N}$ such that they are the same function, the other inclusion should hold too. Would it be more precise to write $\mathcal{M}$ (and $\mathcal{N}$ analogously) as: $$\mathcal{M}:=\{f \ \mathrm{function} \ | \ f:A \to B \times C, f \ \mathrm{continuous}\}$$ which would make it even more precise that the equality of functions is underlying.
I am sorry if my question is somewhat confusing, however I want to make sure to avoid mistakes as much as possible. Since this has never been mentioned in any lecture explicitly and I did not have a definitive and verified answer to this question, I wanted to make sure that my thoughts are right. Furthermore I am unsure if the notion of equality of functions I am using is even correct. Are there situations in which others are used? This would then cause difficulties with some of the equalities. Is this a problem? How can I determine, in which context I am? Thanks in advance for any comment.
 A: (1) It depends on how you define functions. One can define a "raw function" as a set $s$ such that $\forall p \in s \exists! x \exists y (p = (x, y))$. The domain of a raw function is $\{x | \exists y ((x, y) \in s\}$, and the range is $\{y | \exists x ((x, y) \in s)\}$.
A simple way to define the proposition $f : A \to B$ is that $f$ is a raw function with domain $A$ and with range $\subseteq B$. In this case, $f : A \to B$ and $B \subseteq C$ implies $f : A \to C$.
But we could also say that a function is a pair $(g, B)$ such that $g$ is a raw function and the range of $g$ is a subset of $B$. Then we could say that $f : A \to B$ iff $f = (g, B)$ is a function and the domain of $g$ is $A$. In this case, a function is "tagged" with its codomain, so the proposition would not be true.
So it really depends on the exact definition of "function".
(2) We see that $(\pi_B \circ f \times \pi_A \circ f) \circ d_A = f$ for all $f$. This can be easily shown by the universal property of the product. Therefore, we see that $\mathcal{N} = \{f | f : A \to B \times C,$ $f$ continuous$\} = \mathcal{M}$.
