Is there any situation where the joint probability is equal to the marginal probability? Is there any situation in that joint probability $p(x,y)$ equals to marginal probability $p(x)$? What is the interpretation of this situation?
Assume these are the distributions of $(X,Y)$ and $X$, where $X$ and $Y$ are random variables with values in $\mathbb X$ and $\mathbb Y$ respectively, and let (C) denote the condition that [For every $(x,y)$ in $\mathbb X\times\mathbb Y$, $p(x,y)=p(x)$].

First setting: If $\mathbb X$ and $\mathbb Y$ are discrete spaces, (C) is impossible unless $\mathbb Y$ is a singleton, and then (C) is always met. In particular, if $Y$ is almost surely constant but with values in $\mathbb Y$ not a singleton, then (C) is not met.

Second setting: Assume that $\mathbb X$ and $\mathbb Y$ are Borel subsets of some Euclidean spaces and that $p$ and $p$ are densities with respect to some measures $\mu\otimes\nu$ and $\mu$ on $\mathbb X\times\mathbb Y$ and $\mathbb X$ respectively. Then, (C) is never met unless $\nu(\mathbb Y)=1$, and then (C) means that $Y$ has distributon $\nu$ and is independent of $X$.
If $f(x,y)=f(x)$, then $y$ could be $y=x$.