Suppose now I have two multivariate polynomials, say $p_1: \mathbb{R}^n\to\mathbb{R}$ and $p_2: \mathbb{R}^n\to\mathbb{R}$, $n\ge 2$. Suppose they are both irreducible, and $A$, $B$ are the zero sets of $p_1$ and $p_2$ respectively. Suppose "$A$ and $B$ has a common part". This description is not mathematically rigorous, but I cannot find a better way to describe it. So let me give some examples to explain it. For example, in 2D, $A$ and $B$ represent curves. Then "$A$ and $B$ has a common part" means that they share a common sub-arc. In 3D, then they share a common subsurface and so on.
I am wondering under this assumption, can we say that $A$ must be equal to $B$? Or can we say that $p_1$ and $p_2$ are the same up to a scale?
For $n=2$. I think the answer is positive. If we have two curves which are given by the zero sets of the two polynomials, and the two curves share a sub-arc. Then the two irreducible polynomials must be the same up to a scale by Bezout's theorem.
But I do not know what will happen if $n\ge 3$. I guess we will still have the conclusion but I do not know how to show it.
This is already false in the case $n=2$. Every polynomial in the family $ax^2+y^2=0$ for $a>0$ is irreducible over $\Bbb R$ and has the same zero set, $\{(0,0)\}$. But no two distinct members of this family are multiples of each other.
You are right to suspect something like this, though. In algebraic geometry, when working over an algebraically closed field $k$, if two irreducible polynomials $f$ and $g$ have the same zero set inside $k^n$, then $f$ and $g$ are multiples of each other. So if you swap your situation to work over $\Bbb C$, then the conclusion that $f$ and $g$ are multiples of eachother iff their zero sets have a small open complex $(n-1)$-disc in common is true.
Alternatively, in the real case, such a statement may be salvaged if the common zero set has a smooth point. This previous answer of mine contains some more explanation.