Why is the support defined as a closure? In the definition of the support of a real function $f$ on $X$, why is it important to consider the closure of the set $S=\{x\in X:f(x)\neq0\}$ and not just $S$ itself? 

Why is the closure of $S$ called the "support" of $f$ or how did this name come about?
An equivalent, and possibly more natural definition of the support is the following:  a point $x$ is in the support of $f$ precisely when $f$ does not vanish identically on a neighborhood of $x$. With this definition, it is obvious that the support is closed.

Vanishing on a neighborhood of $x$ is a much more significant property than simply vanishing at $x$, and for many purposes, it is the natural condition to consider.
Well in fact it is common (and sensible) to require the closure only if $X$ is a topological space. But actually the term more generally applies for any set, and there you cannot use the closure. (E.g. when dealing with the so called free vector space, or with sequences, one sometimes talk of functions with finite support.) As for why one takes the closure, closed sets are better behaved than arbitrary sets; if the function is defined on euclidean space (and this is a very important case) then bounded support even means compact support, and compact sets are in general very well behaved. Also one often wants to restrict some integral of a product to the support of some of the functions, and you can only integrate over measurable sets (so arbitary sets won't do), think of the Lebesgue measure. How this name came about I can only guess; the support is the only interesting subset of the domain of the function if we concentrate on the properties of the function. Often one defines functions so as to have some prescribed support, e.g. the unit ball.