Suppose that $a \in \mathbb{C}$ is algebraic over $\mathbb{Q}$ with $p(x) = \min(\mathbb{Q},a)$, and let $b$ be any root in $\mathbb{C}$ of $p$. Show that the map $\sigma:\mathbb{Q}(a) \to \mathbb{C}$ given by $\sigma(f(a)) = f(b)$ is a well-defined $\mathbb{Q}$-homomorphism.
I showed that $\sigma$ is a $\mathbb{Q}$-homomorphism, but I couldn't show that it's well-defined. I tried to take $f,g \in \mathbb{Q}[x]$ such that $f(a) = g(a)$ for conclude that $f(b) = g(b)$. I should probably use $\min(\mathbb{Q},a)$ or $b$ be root of $p$, but I don't know how. Any hint?
UPDATE. $f(a)=g(a) \Longrightarrow (f-g)(a) = 0$, so $p|(f-g)$. Then $(f-g)(x) = p(x)q(x)$, but $p(b) = 0$. Thus, $(f-g)(b)=0\Longrightarrow f(b)=g(b)$. Is correct?