Why was Ramanujan interested in the his tau function before the advent of modular forms? The machinery of modular forms used by Mordel to solve the multiplicative property seems out of context until I know the function's use and value to Ramanujan at the time.

4$\begingroup$ What do you mean when you say that this was before the advent of modular forms? Jacobi came up with the product formula long before Ramanujan. $\endgroup$ – S. Carnahan♦ Mar 23 '14 at 15:26
All questions of the form "Why was such a mathematician interested in such a subject?" are difficult, and have a tendency to becomes metaphysical ("why are we doing mathematics in general?", and then "why are we here, anyway?"), but they are even harder when they concern Ramanujan, who had a nonstandard mathematical formation and a very original mind.
You're right that Ramanujan could not have been influenced in his interest in the tau sequence by our modern vision of this function as the prototype of the general sequence of coefficients of modular forms, with all the connections to algebraic geometry and number theory that are now familiar, since on the contrary the modern theory of modular forms was developed by Mordell and Hecke after and motivated by Ramanujan's results and questions about the $\tau$ function.
So how could Ramanujan have been interested in the $\tau$function? Well, Ramanujan all his life, and well before he came to England and met Hardy, was interested in $q$series, roughly the study of certain formal power series in one variable ($q$), and he valued very much his results that took the form of nontrivial identities between two $q$series. It is an old subject, which begins with Euler (for example his "pentagonal number theorem" for $\prod_n (1q^n)$), and is deeply connected to combinatorics, yet it was at the time of Ramanujan (and to some extent still is) a little bit outside of mainstream research. But from this point of view, the study of the $\tau$function, defined as the coefficients of $q \prod (1q^n)^{24}$ fits well into Ramanujan's lifelong interests. And if you're worried about the exponent $24$, remember that Ramanujan dealt with much more baroque formulas.
There is another reason to be interested in the $\tau$function, namely that it is the sequence of Fourier coefficients of the Weierstrass Deltafunction $\Delta(z)$. Now the function $\Delta(z)$ was extremely important (and mainstream) in the mathematics of Ramanujan's time, being central in the theory of elliptic functions (or integrals or curves) and interconnected with the work of many mathematicians of the nineteenth century on complex analysis, Riemann surfaces, and algebraic geometry. Ramanujan was not aware of all these connections before he met Hardy (at least according to the latter, who said Ramanujan had almost no knowledge of complex analysis and the theory of elliptic functions) but after that he become very interested in the subject.

7$\begingroup$ Also Ramanujan was interested in representations of numbers by quadratic forms, and in particular the number of representations of an integer as the sum of an even number of squares. Exact formulas were known in a number of cases already, and he might have been trying to extend these. As I recall, his famous paper begins by writing down identities for the products of Eisenstein series, and records the first case where one doesn't have an exact identity, and this comes from the tau function. $\endgroup$ – Lucia Mar 23 '14 at 17:53

$\begingroup$ I have no idea what the last sentence of the third paragraph means, but somehow I really want to. $\endgroup$ – Ramsey Mar 23 '14 at 18:30

$\begingroup$ Nick: I edited that sentence to clarify what I think was meant. Remember that Hardy commented about the identities in Ramanujan's letters to him that they "must be true, because, if they were not true, no one would have the imagination to invent them." $\endgroup$ – KConrad Mar 23 '14 at 18:59

$\begingroup$ Keith: Thanks! That's sort of what I thought he was getting at too. I guess what I find curious is that I'm "worried about the exponent 24" but not because it adds to the extravagance of the expression. This is the only exponent that makes it modular. To ask a rather figurative version of the OP's question: How did he know this? Relatedly, why didn't he just do away with the leading $q$ since it adds little apparent interest to the series without knowing something about modularity? $\endgroup$ – Ramsey Mar 24 '14 at 1:11

$\begingroup$ About the specific exponent $24$ I think it has to do with another aspect of Ramanujan's research on $q$ series. Ramanujan had already discovered theta functions of jacobi (in different notation) and had found many modular equation. From here he got to singular moduli and he was specially interested in functions $f(q)$ which take algebraic values when $q = e^{\pi\sqrt{n}}$ or functions $f(q)$ which could be expressed as algebraic functions of $(2K/\pi)$ and modulus $k$. It is now obvious that only exponent $24$ can satisfy such criteria. $\endgroup$ – Paramanand Singh Apr 6 '14 at 11:32
Why not simply looking at the original source?
Ramanujan made his famous conjectures in On certain arithmetical functions Transactions of the Cambridge Philosophical Society XXII (1916), a source which is easily available (here for instance). In this paper, he intends to study the sum \begin{equation} \sum_{r,s}(n)=\sum_{i=0}^{n}\sigma_{r}(i)\sigma_{s}(ni)=\sigma_{r}(0)\sigma_{s}(n)+\cdots+\sigma_{r}(n)\sigma_{s}(0) \end{equation} where as usual $\sigma_{s}(u)$ is the sum of the $s$th power of the divisors of $u$ if $u\neq 0$ and $\sigma_{s}(0)$ is normalized to be $\zeta(s)/2$. His main theorem is to relate $\sum_{r,s}(n)$ to a close formula in terms of the $\Gamma$ and $\zeta$ functions as well as $\sigma_{r+s\pm 1}$. If $r+s=2,4,6,8$ or $12$, this close formula exactly calculates $\sum_{r,s}(n)$ but otherwise there is in addition an error term he denotes by $E_{r,s}(n)$.
He then goes on to observe that if $r+s=10,14,16,18,20$ or $24$, then $E_{r,s}(n)$ involves, as a function of $n$, only the constant $E_{r,s}(1)$, possibly $\sigma_{r+s11}(n)$ and the function $\tau(n)$ defined by the $q$expansion \begin{equation} \sum_{n=1}^{\infty}\tau(n)=q\prod_{n=1}^{\infty}(1q^n)^{24}. \end{equation} When $r+s=10$, the simple formula $E_{r,s}(n)=E_{r,s}(1)\tau(n)$ obtains. Hence $\tau(n)$ appears in this original paper as a measure of the size of an error term. In particular, Ramanujan is extremely interested in bounding its size. He shows that $\tau(n)$ (and thus the error term) is not a $o(n^5)$, that it is a $O(n^7)$ and then conjectures (famously) that $\sum_{n=1}^{\infty}\tau(n)n^{s}$ admits an Eulerian product and that $\tau(n)\leq n^{11/2}d(n)$ for all $n$. He goes on to note that this entails that $\tau(n)$ is not a $o(n^{11/2})$.
So there you have it: Ramanujan was interested in $\tau(n)$, in its arithmetical properties and in its size because it occurs as an error term in a formula he established to compute "convolutions" of the $\sigma$ functions. The two (or depending on the presentation three, but the original paper has two) statements called the Ramanujan conjecture directly bears on this question of estimating the error term; his central concern. From a modern perspective, we would probably follow the converse path, that is to say, we would note that logarithmically differentiating the $\Delta$ function yields many identities relating $\tau(n)$ and $\sigma(n)$, though that of course also originates from his computations. The paper is worth reading, but following Ramanujan's computations can prove a rough ride.
Well, it certainly is difficult (and probably, as far as I am concerned, a bit immodest...) to try to understand the motivations of the greatest mathematical genius of the last millenium, but, long before him, Euler had studied the expansion of $~\prod\limits_{k=1}^{\infty}(1x^k),~$ Dedekind had defined $$~\eta(\tau)=\exp(i\pi\tau/12)\prod\limits_{k=1}^{\infty}(1\exp(2i\pi k \tau)),~$$ and the formula $$~\Delta(\tau)=(2\pi)^{12}\exp(2 i\pi\tau)\prod\limits_{k=1}^{\infty}(1\exp(2i\pi k\tau))^{24}=(2\pi)^{12}\eta^{24}(\tau)$$ $$= (2\pi)^{12}x \prod\limits_{k=1}^{\infty}(1x^k)^{24}~,$$
with $~x=\exp(2 i\pi\tau)~$ was assuredly known. So, Ramanujan, whose computing abilities were truly amazing, maybe considered the expansion of $~x\prod\limits_{k=1}^{\infty}(1x^k)^{24}~$ as beeing worth the effort, and thus discovered that his ``$\tau$function" was multiplicative and seemed to satisfy marvellous identities...
But maybe I'm just tasseographing ("tealeaves reading") the mathematical past.

$\begingroup$ This is a beautiful perspective. Thank you for relating it to the polynomial determinent of Dedekind. $\endgroup$ – Catherine Ray Oct 10 '15 at 19:48