If all one intends to do with a function is write it down, then it might be simpler to write the function as a rule which has some "if ...then..." conditions in it than write it as an infinite series. For example, a square wave (as a function of time alone) could be written in a format like: if ( n < t < n+1 and n is an even integer) then f(t) = 1. Otherwise f(t) = 0. If you need to integrate or differentiate a function, the "if...then..." conditions can be a nuisance and it may simpler to deal with the infinite series.
A true square wave isn't differentiable at the jumps. In a situation (such as in electronics) when we are dealing with a nominal square wave, we could make a realistic model for the nominal square wave by using some "if...then..." conditions to round the shape of the jumps. However, it may be simpler to think of the square wave as an infinite series and then neglect some of the terms of the series in order to achieve the same sort of approximation.
The "response" of some physical systems to an "input" (e.g. the effect of a electronic filter on an input signal) may be simple to analyze when the input is a sine or cosine function. For a linear system, the response to the sum of inputs is the sum of the responses to the individual inputs. Hence the simplest analysis is often to represent an input signal as a sum of sine and cosine functions and compute the response as the sum of the individual responses.