What are imaginary numbers? At school, I really struggled to understand the concept of imaginary numbers.  My teacher told us that an imaginary number is a number that has something to do with the square root of $-1$.  When I tried to calculate the square root of $-1$ on my calculator, it gave me an error.  To this day I still do not understand imaginary numbers.  It makes no sense to me at all.  Is there someone here who totally gets it and can explain it?

Why is the concept even useful?
Let's go through some questions in order and see where it takes us. [Or skip to the bit about complex numbers below if you can't be bothered.]

What are natural numbers?

It took quite some evolution, but humans are blessed by their ability to notice that there is a similarity between the situations of having three apples in your hand and having three eggs in your hand. Or, indeed, three twigs or three babies or three spots. Or even three knocks at the door. And we generalise all of these situations by calling it 'three'; same goes for the other natural numbers. This is not the construction we usually take in maths, but it's how we learn what numbers are.


  Natural numbers are what allow us to count a finite collection of things. We call this set of numbers $\mathbb{N}$.


What are integers?

Once we've learnt how to measure quantity, it doesn't take us long before we need to measure change, or relative quantity. If I'm holding three apples and you take away two, I now have 'two fewer' apples than I had before; but if you gave me two apples I'd have 'two more'. We want to measure these changes on the same scale (rather than the separate scales of 'more' and 'less'), and we do this by introducing negative natural numbers: the net increase in apples is $-2$.


  We get the integers from the naturals by allowing ourselves to take numbers away: $\mathbb{Z}$ is the closure of $\mathbb{N}$ under the operation $-$.


What are rational numbers?

My friend and I are pretty hungry at this point but since you came along and stole two of my apples I only have one left. Out of mutual respect we decide we should each have the same quantity of apple, and so we cut it down the middle. We call the quantity of apple we each get 'a half', or $\frac{1}{2}$. The net change in apple after I give my friend his half is $-\frac{1}{2}$.


  We get the rationals from the integers by allowing ourselves to divide integers by positive integers [or, equivalently, by nonzero integers]: $\mathbb{Q}$ is (sort of) the closure of $\mathbb{Z}$ under the operation $\div$.


What are real numbers?

I find some more apples and put them in a pie, which I cook in a circular dish. One of my friends decides to get smart, and asks for a slice of the pie whose curved edge has the same length as its straight edges (i.e. arc length of the circular segment is equal to its radius). I decide to honour his request, and using our newfangled rational numbers I try to work out how many such slices I could cut. But I can't quite get there: it's somewhere between $6$ and $7$; somewhere between $\frac{43}{7}$ and $\frac{44}{7}$; somewhere between $\frac{709}{113}$ and $\frac{710}{113}$; and so on, but no matter how accurate I try and make the fractions, I never quite get there. So I decide to call this number $2\pi$ (or $\tau$?) and move on with my life.


  The reals turn the rationals into a continuum, filling the holes which can be approximated to arbitrary degrees of accuracy but never actually reached: $\mathbb{R}$ is the completion of $\mathbb{Q}$.


What are complex numbers? [Finally!]

Our real numbers prove to be quite useful. If I want to make a pie which is twice as big as my last one but still circular then I'll use a dish whose radius is $\sqrt{2}$ times bigger. If I decide this isn't enough and I want to make it thrice as big again then I'll use a dish whose radius is $\sqrt{3}$ times as big as the last. But it turns out that to get this dish I could have made the original one thrice as big and then that one twice as big; the order in which I increase the size of the dish has no effect on what I end up with. And I could have done it in one go, making it six times as big by using a dish whose radius is $\sqrt{6}$ times as big. This leads to my discovery of the fact that multiplication corresponds to scaling $-$ they obey the same rules. (Multiplication by negative numbers responds to scaling and then flipping.)

But I can also spin a pie around. Rotating it by one angle and then another has the same effect as rotating it by the second angle and then the first $-$ the order in which I carry out the rotations has no effect on what I end up with, just like with scaling. Does this mean we can model rotation with some kind of multiplication, where multiplication of these new numbers corresponds to addition of the angles? If I could, then I'd be able to rotate a point on the pie by performing a sequence of multiplications. I notice that if I rotate my pie by $90^{\circ}$ four times then it ends up how it was, so I'll declare this $90^{\circ}$ rotation to be multiplication by '$i$' and see what happens. We've seen that $i^4=1$, and with our funky real numbers we know that $i^4=(i^2)^2$ and so $i^2 = \pm 1$. But $i^2 \ne 1$ since rotating twice doesn't leave the pie how it was $-$ it's facing the wrong way; so in fact $i^2=-1$. This then also obeys the rules for multiplication by negative real numbers.

Upon further experimentation with spinning pies around we discover that defining $i$ in this way leads to numbers (formed by adding and multiplying real numbers with this new '$i$' beast) which, under multiplication, do indeed correspond to combined scalings and rotations in a 'number plane', which contains our previously held 'number line'. What's more, they can be multiplied, divided and rooted as we please. It then has the fun consequence that any polynomial with coefficients of this kind has as many roots as its degree; what fun!


  The complex numbers allow us to consider scalings and rotations as two instances of the same thing; and by ensuring that negative reals have square roots, we get something where every (non-constant) polynomial equation can be solved: $\mathbb{C}$ is the algebraic closure of $\mathbb{R}$.


[Final edit ever: It occurs to me that I never mentioned anything to do with anything 'imaginary', since I presumed that Sachin really wanted to know about the complex numbers as a whole. But for the sake of completeness: the imaginary numbers are precisely the real multiples of $i$ $-$ you scale the pie and rotate it by $90^{\circ}$ in either direction. They are the rotations/scalings which, when performed twice, leave the pie facing backwards; that is, they are the numbers which square to give negative real numbers.]

What next?

I've been asked in the comments to mention quaternions and octonions. These go (even further) beyond what the question is asking, so I won't dwell on them, but the idea is: my friends and I are actually aliens from a multi-dimensional world and simply aren't satisfied with a measly $2$-dimensional number system. By extending the principles from our so-called complex numbers we get systems which include copies of $\mathbb{C}$ and act in many ways like numbers, but now (unless we restrict ourselves to one of the copies of $\mathbb{C}$) the order in which we carry out our weird multi-dimensional symmetries does matter. But, with them, we can do lots of science.

I have also completely omitted any mention of ordinal numbers, because they fork off in a different direction straight after the naturals. We get some very exciting stuff out of these, but we don't find $\mathbb{C}$ because it doesn't have any natural order relation on it.

Historical note

The above succession of stages is not a historical account of how numbers of different types are discovered. I don't claim to know an awful lot about the history of mathematics, but I know enough to know that the concept of a number evolved in different ways in different cultures, likely due to practical implications. In particular, it is very unlikely that complex numbers were devised geometrically as rotations-and-scalings $-$ the needs of the time were algebraic and people were throwing away (perfectly valid) equations because they didn't think $\sqrt{-1}$ could exist. Their geometric properties were discovered soon after.

However, this is roughly the sequence in which these number sets are (usually) constructed in ZF set theory and we have a nice sequence of inclusions
$$1 \hookrightarrow \mathbb{N} \hookrightarrow \mathbb{Z} \hookrightarrow \mathbb{Q} \hookrightarrow \mathbb{R} \hookrightarrow \mathbb{C}$$

Stuff to read


The other answers to this question give very insightful ways of getting $\mathbb{C}$ from $\mathbb{R}$ in different ways, and discussing how and why complex numbers are useful $-$ there's only so much use to spinning pies around.
A Visual, Intuitive Guide to Imaginary Numbers $-$ thanks go to Joe, in the comments, for pointing this out to me.
Some older questions, e.g. here and here, have some brilliant answers.


I'd be glad to know of more such resources; feel free to post any in the comments.
As no one has mentioned about this, here is an excellent intuitive video series (that shouldn't be missed) by Welch Labs as Imaginary Numbers are Real. 

These are a set of 13 videos that beautifully help with the visualization of complex numbers from A Simple Complex Plane, all the way up to Riemann Surfaces. Here is something from the videos to get you interested.

Consider a Function $f(x)=x^{2}+1$.

Here is the plot of the function in the real x-y plane: 



(Source: WolframAlpha)

Now according to the Fundamental Theorem of Algebra we should have n-roots for n-th degree polynomial but if you consider the graph for the given function it doesn't appear to intersect the x-axis right ?

Well, the thing is, we are not seeing it correctly and have not included a fundamental set of numbers : Complex Numbers which have both real and imaginary part but don't get confused yet as both the parts are quite real.The below GIF from the above videos beautifully plots the the function in the Complex plane (The vertical axis that comes out of the paper being the imaginary axis).



(Source: Welch Labs)

So you can see that the function actually intersects the x-axis but in a different dimension and that is the imaginary plane. This gives an excellent intuitive sense of why imaginary numbers are very real! I would recommend the users to view all the videos as there's a lot of graphic animations for better visualization and understanding.