Currently I am studying varieties over $\mathbb{C}$ and I know some scheme theory.
My professor mentioned the other day that given a morphism of varieties over an alg. closed field $k$: $f: X \rightarrow Y$, one should count fibres "with multiplicity". I have been trying to make sense of this. It is especially important for me if $Y$ is a curve and the fibres are divisors of $X$.
So I looked in Hartshorne, dusted off my scheme knowledge, and rediscovered the scheme theoretic fibre $X_y := X \times_Y \text{Spec}(k(y))$ for some $y \in Y$. I worked out an example: $f: \mathbb{A}^2 \rightarrow \mathbb{A}^2$, $(a,b) \mapsto (a^2,b)$. A calculation shows that the fibre over a point $(p,q)$ is the spectrum of $k[x,y]/(x^2-p,y-q) \cong k[x]/(x^2-p)$, which is reduced and consists of two different points if $p \neq 0$, and a nonreduced one point scheme if $p=0$.
Really similarly $g: \mathbb{A}^1 \rightarrow \mathbb{A}^1$, $a \mapsto a^2$, then the fibre is the spectrum of $k[x]/(x^2-p)$. I mention these two examples since in one case, the points and fibres are divisors, in the other they are not.
This is all no problem at all, however i am trying to translate this back into varieties, trying to make sense of what "counting with multiplicities" should mean.
Now the questions.
How does one translate this into the language of varieties? It seems obvious from the above that the fibre of $(0,q)$ should be $2(0,q)$, since this "doubling" is hidden in the structure sheaf. This would be especially important if the points were divisors, since then 2 times a point makes a lot of sense. But how to make this mathematically precise? As in, what is the actual mathematical procedure? I guess if we can factor the ideal by which we are modding out into prime ideals, we can count the prime factors (i.e. varieties) with multiplicity, BUT: is this factoring always possible? And is this the right method?
I did a course on Riemann surfaces, there multiplicity was also defined: a holomorphic map is locally at a point always of the form $z \mapsto z^n$, then $n$ is the multiplicity of the map at that point. I'm quite sure the definitions agree, of course assuming $k=\mathbb{C}$ and the varieties to be smooth. Can anyone give an argument why?
An ideal answer could include a reference to the two examples, point out differences if there are any (coming from the fact that fibres are/are not divisors) and a general method for writing down a fibre in the language of varieties. If this is only possible in the case of fibres being divisors, i'd still be really happy.
Thanks a lot!
Edit: Thanks a lot for your answers, Andrew and Froggie! There is a small question left. I should give you a motivation for my question: somewhere in Beauville there is a map $f: S \rightarrow C$ where $C$ is a curve, then the inverse image of a point turns out to be the divisor $nE$, where $E$ is a curve on $S$ and $n>1$. So this is why i expected that there at least would be a notion of "multiplicity" in the language of varieties if the fibres were divisors. But as i realize now, there is also the notion of $f^*: \text{Div}(C) \rightarrow \text{Div}(S)$, which is most probably what Beauville used (i havent checked this). So new question: does this $n$ always agree with the multiplicity that you defined Froggie? Is there any other way to relate the scheme theoretic multiplicity and the multiplicity of divisors?