When we define "functions", we should also have to define domain and co-domain but sometimes it is not defined in gate.
Here, domain is defined but co-domain is not defined, so I am taking it as set of real numbers.
So, we have $f:\mathcal{R} \rightarrow \mathcal{R}$ and $g:\mathcal{R} \rightarrow \mathcal{R}$
Now, two functions $f$ and $g$ are equal if they have the same domain and codomain and for every element $x$ in the domain (because dom(f)=dom(g)), $f(x)=g(x).$
for example, $f(x)=\dfrac{x}{2}$ and $g(x)=\dfrac{2x}{4}$
But, here, we have given two equal functions where $x$ and $y$ may or may not be same i.e. $f(x)=g(y)$ where $x$ and $y$ belongs to the set of real numbers.
So, $\forall x,y \in \mathcal{R}, $ $f(x) = g(y)$ and it is true when all $x \in \mathcal{R}$ maps to some element, say, $c$ where $c$ belongs to set $\mathcal{R}$ which is the codomain of $f$ and similarly, all $y \in \mathcal{R}$ maps to same element $c$ where $c$ belongs to set $\mathcal{R}$ which is the codomain of $g$ and in this way both domain and codomain of $f$ and $g$ are equal and $\forall x,y \in \mathcal{R},$ $f(x)=f(y) = c$ where $c$ is some arbitrary constant.
Hence, $\textbf{(B)}$