This history is described in Euler and the Zeta Function by Raymond Ayoub (1974). In his early twenties, around 1730, Euler considered the celebrated problem to calculate the sum $$\zeta(2)=\sum_{n=1}^\infty \frac{1}{n^2}.$$ This problem goes back to 1650, it was posed by Pietro Mengoli and John Wallis computed the sum to three decimal places. Ayoub conjectures that it was Daniel Bernoulli who drew the attention of Euler to this challenging problem. (Both lived in St. Petersburg around 1730.)
Euler first publishes several methods to compute the sum to high accuracy, arriving at $$\zeta(2)=1.64493406684822643,$$ and finally obtained $\pi^2/6$ in 1734. (We know this date from correspondence with Bernoulli.) It was published in 1735 in De summis serierum reciprocarum.
$1+\frac{1}{4}+\frac{1}{9}+\frac{1}{16}+\frac{1}{25}+\frac{1}{36}+\text{etc.}=\frac{p^2}{6}$, thus the sum of this series multiplied by 6 equals the square of the circumference of a circle that has diameter 1. [Notice that the symbol $\pi$ was not yet in use.]
The generalization to $\zeta(s)$ with integers $s$ larger than two followed in "De seribus quibusdam considerationes". In 1748, finally, Euler derives a functional equation relating the values at $s$ and $1-s$ and conjectures that it holds for any real $s$. (Euler's functional equation is equivalent to the one proven a century later by Riemann.).