Why did mathematician construct extended real number systems, $\mathbb R \cup\{+\infty,-\infty\}$? I know some properties cannot be defined with the real number system such as supremum of an unbounded set. but I want to know the philosophy behind this construction (extended real number system ($\mathbb R \cup\{+\infty,-\infty\} $) and projectively extended real number system ($\mathbb R \cup\{\infty\}$)) and why did mathematician want to do so? what are the beautiful properties they achieved? I want an answer with a philosophical point of view. 
P.S. is there any books or notes or something which I can refer?
 A: I forgot this when writing my comments to the question, but one reason is compactness.
For example, using the extended reals, the Extreme Value Theorem, "A continuous function on a compact interval is bounded", has the following corollary: "A continuous function on $\Bbb R$ with $\lim_{x\to\infty}f(x)$ and $\lim_{x\to-\infty}f(x)$ defined is bounded". Without the extended reals, we'd have to prove it separately.
A: Often in mathematics, the best way to understand "extended" systems is that we really didn't extend anything at all, we just came up with the language to describe a phenomenon or a pattern that was already there. 
For example, in standard geometry lines either cross at a unique point or are parallel. In projective geometry we say that all lines cross: but possibly at a point at infinity. This is literally just giving a different name to parallel lines. We invented new words. But this new language allows us to express patterns in the mathematics which we didn't invent at all: they were there all along.
Take the real line extended with $\{+\infty, -\infty\}$, and also extend the arithmetic operators to these two new points in the obvious ways (with the unobvious ways being left undefined: $\infty - \infty$ and $\frac \infty \infty$). Then the following are all perfectly rigorously stated theorems:


*

*Any monotone function converges.

*If $f$ and $g$ converge, then $\lim (f + g) = \lim f + \lim g$. (Edit: as long as we don't have $f\to+\infty$ and $g\to-\infty$ or vice versa, but eg $f\to\infty$ and $g\to5$ will still work)

*Every set has a supremum and infinimum.

*A continuous function on a closed interval is bounded and attains its bounds. For example, $x^2$ on the closed interval $[-\infty, +\infty]$ attains its bounds: $\infty^2 = +\infty$.

*A sequence of points in a closed interval must contain a convergent subsequence.


The real line is already extended. We're just defining language to express that fact.
A: From a "philosophical point of view", one of the reasons to define the extended real numbers is because the numbers $\pm \infty$ quantify a number of numerical and geometric mathematical objects and notions and make things simpler overall. In other words, they didn't do it for the sake of philosophy, they did it for the sake of mathematics.
One of the very simplest examples is that we use them in expressing intervals; the set of positive real numbers can be expressed as $(0, +\infty)$, with $0$ and $+\infty$ being the (excluded) endpoints of the interval.
Another example is that, rather than having nearly a dozen different ad-hoc extensions of the notion of limit, things like $\lim_{x \to 0} 1/x^2 = +\infty$ are simply ordinary limits in the sense of topology rather than simply being ad-hoc formal notation. $1/x^2$ converges to $+\infty$ as $x \to 0$.
Similarly, a number of standard functions can be continuously extended to have values at $\pm \infty$, simplifying various things such as the calculation of limits. For example, we can define things like $\log(+\infty) = +\infty$ or $\arctan(+\infty) = \frac{\pi}{2}$, and these functions remain continuous.
The extended real numbers are also the simplest extension of the real line to have the full least upper bound property: every subset of the extended real line has a least upper bound in the extended real numbers.
Topologically, the extended real line is a compact topological space. Compact topological spaces are extremely nice. For example, every continuous real-valued function on the extended real line has a maximum value. (not just a supremum!) This lets you instantly prove theorems like

Theorem: Let $f$ be a continuous function $\mathbb{R} \to \mathbb{R}$ such that $\lim_{x \to \infty} f(x)$ and $\lim_{x \to -\infty} f(x)$ are real numbers. Then $f$ is bounded.

simply by removing the discontinuities at $\pm \infty$ to get a continuous function on the extended real line.

The projective real line, AFAIK, comes out of (algebraic) geometry.
The projective plane was an important advance in the field of Euclidean geometry, and the projective real numbers are simply the one-dimensional version of that.
It turns out that projective spaces play a central role in doing geometry algebraically.
A: I think the most extreme philosophical reason might be that mathematics is invented by mathematicians who are curious and inventive and invent things they find beautiful. Or, thinking as a Platonist, all those structures are out there in some sense and mathematicians exploring that world stumble on these extended structures and like spending time thinking about them.
In a narrower sense, many of these extensions are a kind of "completion". You need the negative integers in order be able to subtract, so you extend the natural numbers. You need the rationals to divide. You need the reals to have a square root of $2$ (actually, you need only the algebraics for that). You need the complex numbers to have a square root of $-1$ - and then you get the fundamental theorem of algebra as a consequence. (And you can extend the real numbers to include infinitesimal numbers, then do calculus with those instead of the usual treatment with limits.) So the extensions are meant to solve problems. 
If you're then just curious you can look for multiplicative structures in higher dimensional Euclidean spaces, prove there are none in dimension $3$, find the quaternions in dimension $4$, and prove there are no more unless you give up associativity. That's an interesting story.
You extend the plane to add points and a line at infinity so that the axioms become neater and more symmetrical: two points determine a line, two lines determine a point. Then you get some nice theorems, and, if you're a painter in the Renaissance, you codify perspective.
In reality (if you'll allow the word) most of the extensions are not just "adding elements to structures". They are abstractions. Groups capture the idea of symmetry. Calculus captures the idea of change. Geometry and topology capture the idea of shape.

Edit in response to comment.
For the Platonist there's no distinction between the real world and the abstract one. All those fancy mathematical notions are real, out there somewhere. Just as real as the interiors of stars are to an astrophysicist. We explore them to discover how they behave. In both physics and mathematics, the things we explore are further and further from the part of the real world we can touch and see, but no less real for that. 
By the way, not all mathematicians are Platonists. There   are  good philosophical arguments that claim  humans invent mathematics, not discover it
But I think most working mathematicians, whether Platonist or not, believe in the reality of their subject matter. They only differ about whether it's invented or discovered. Only outsiders say "that's abstract, not real". 
