Origins of functional field arithmetic Background: By function field, we mean a finite extension of the field of rational functions of one variable over a finite field with $p$ elements. Classfield theory for function fields was established by Chevalley in an Annals paper. An axiomatic characterization for number fields and function fields was established by Artin and Whaples, thus finally putting on firm ground the analogy between function fields and number fields. I have seen allusions that the germ of the idea was coming from Gauss. However since fields were not defined then, this was not a definitive statement.
Question: When was a definitive conjecture first made in mathematical history that there is a major analogy between algebraic number fields and function fields over finite fields?
 A: One of the most early observations on the analogy between function fields and number fields is the little known work by 


*

*E. Heine, 
 Fernere Untersuchungen über ganze Functionen,
J. Reine Angew. Math. 48 (1854), 243--266 


who started investigating quadratic forms with coefficients in polynomial rings. 
Dedekind's and Weber's contributions have already been mentioned, but not those of Robert König, who investigated the connection between quadratic function fields and quadratic forms with polynomial coefficients in various publications prior to Artin
(and perhaps just as unknown as Heine's contribution):


*

* Über die quadratischen Formen mit rationalen Funktionen als Koeffizienten, 
Monatsh. f. Math. Phys. 23 (1912), 321-346

*Beiträge zur Arithmetik der hyperelliptischen Funktionenkörper,
J. Reine Angew. Math. 142 (1913), 191-210


He also explicitly stated the analogy between function fields and number fields in the titles (and the body) of the following two papers


*

*Arithmetisch-funktionentheoretische Parallelen,
Jahresber. DMV 23 (1914), 181--192

*Funktionen- und zahlentheoretische Analogien,
Jahresber. DMV 28 (1920), 208-213.


The constant fields investigated by König have characteristic 0, however. 
A: Encouraged by Regenbogen, I am upgrading my comment to an answer: at least one of the first, and greatest, promoters of the analogy between number fields and function fields in much the way we view it today, was Emil Artin.  His 1921 thesis seems to be the first work to consider the Riemann hypothesis in the function field case.
As Regenbogen points out, a very nice article for historical information about this is Roquette's The Riemann hypothesis in characteristic p, its origin and development:
http://www.rzuser.uni-heidelberg.de/~ci3/rv.pdf
I believe that I had in fact read this article previously (at least the beginning), and that my guess was a sort of second-rate memory.
Note that on p. 7 Roquette also mentions results of Dedekind in 1857 -- e.g. quadratic reciprocity for $\mathbb{F}_q[t]$ -- that already demonstrate some awareness of the analogy.  Whether you wish to consider Dedekind's work as early history or prehistory seems, as far as I can tell, to be a matter of taste.
A: If you want to go back to smallest germ of the idea that functions
behave like numbers, then it is perhaps in Stevin's L'arithmetique of 1585,
where he uses the Euclidean algorithm to find the gcd of two polynomials.
I'm not sure what Gauss's contribution may have been -- maybe Gauss's lemma? 
As KConrad has pointed out, a big contribution was made by
Dedekind and Weber in 1882 (J. reine und angewandte Math. 92, 181-290). 
In the same journal (pp. 1-122) there is a less reader-friendly paper by
Kronecker which seems to cover some of the same ground. 
A: Maybe there are some perceptions of the analogy in the work of Gauss, but for certain the close relation between Z and F[x] where F is a finite field was established in 1857 in a paper of Dedekind, which went so far as to formulate a version of the quadratic reciprocity law when F has odd characteristic.  
In 1919, Kornblum used L-functions on F[x] to prove an analogue of Dirichlet's theorem (for irreducible polynomials in arithmetic progression).  While those L-functions could after the fact be viewed as L-functions of characters on a function field, Kornblum worked with characters on (F[x]/(f))*, much as one can prove Dirichlet's theorem without any hint that there are number fields (inside cyclotomic extensions) lying in the background. 
In 1921, Artin's thesis on quadratic function fields laid out probably for the first time how close number fields and function fields over finite fields (not only Q and rational function fields) are.  For example, he defined concepts of real and imaginary quadratic function fields, showed units in the "real" case could be found by something like a continued fraction algorithm (if I'm not mistaken) and he computed examples of their zeta-functions and could verify in those examples that the Riemann hypothesis was true.
A simple and convenient place to find a treatment of this history is Peter Roquette's website 
https://www.mathi.uni-heidelberg.de/~roquette/manu.html
and a direct link to his paper laying out this analogy is the paper
https://www.mathi.uni-heidelberg.de/~roquette/rv.pdf.
I also recommend the first chapter of A. D. Thomas' "Zeta-Functions: An Introduction to Algebraic Geometry" for a careful explanation of what Artin did in his thesis, particularly the confusion over affine vs. projective notions (which weren't really cleared up until the work of F. K. Schmidt on the zeta-function a few years after Artin's thesis). 
In addition to the work on this analogy between number fields and function fields over finite fields, you shouldn't forget about the analogy between number fields and function fields over the complex numbers.  In 1882, Dedekind and Weber developed the theory of Riemann surfaces purely algebraically, using ideas from algebraic number theory.  They went so far as to say their work applied not just to function fields over C, but over any algebraically closed field of characteristic 0, such as the field of algebraic numbers.  
