Understanding a set $X$ through its functions to the real number set In the first lecture of analysis, I was told that one of the motivation behind studying real numbers is that we can understand the behavior of a set by looking into the functions from this set to the set of real numbers. How ? 
 A: I don't have a good high-level answer, but here's a concrete result. Let $C(X)$ be the set of continuous functions $X\to\mathbb R$. It turns out that $C(X)$ inherits lots of structure from $\mathbb R$, and this structure is enough to characterize $X$ in the following sense. If $X$ and $Y$ are compact Hausdorff spaces, and $C(X)$ and $C(Y)$ are isomorphic as rings or as lattices, then $X$ and $Y$ are homeomorphic. (source)
Hopefully someone else can explain this a little better. :)
A: It is a very general idea that to study some "geometric space" one can study the "ring of functions" on that space and can get quite alot (sometimes complete) information from the ring of functions. Let me mention just a few.
1.) In algebraic geometry, the ring of polynomials characterize the variety (I might be stating this wrong, I am not an algebraic geometer).
2.) As was already mentioned the space of continuous (complex, or real) valued function characterize the topology of the space.
3.) The ring of smooth functions characterizes the diffeomorphism class of a manifold. 
4.) The ring of measureable functions on a measure space characterizes the measure space.
If you notice in each case, a certain type of structure on a set is characterized by the functions which preserve this structure (Note that in the examples you might have to restrict the class of "space" you are considering, (for example in 2.) as stated you must assume compact Hausdorff, though it is possible to get any locally compact hausdorff space as well).
These types of ideas are very old, and there is some high-level explanations (in terms of sheaves) that give some connections between these, and why they occur. I should say though that this isn't necessarily particularly helpful. So for example, the equivalence in 2.) is not particularly useful for studying topological spaces (though it does lead to much interesting mathematics).
Finally, besides these big picture examples it is very often that case that studying $\textit{specific}$ functions on a space can be extremely useful. I will mention just two examples, though there are many others.
1.) The basic idea of morse theory is to "discover" the cell structure of a manifold by analyzing the critical points of a real valued differentiable function on the manifold.
2.) Harmonic analysis on arbitrary groups is largely the theory of analyzing groups by way of functions (real-valued, or otherwise) on the group. 
I hope this informs without overwhelming :)
