What are the main uses of convex functions? Up till now I have just learned that the concept of convexity in functions of one variable is used to complete the graphs of functions, meaning to locate points of inflexion and see if the graph is concave or convex in given intervals. Spivak's book mention that altough this is what we typically learn at calculus, the importance of this concept doesn't lie precisely on ploting graphs and it is really worth to assimilate the information. I'd like to know the main aplications of this concept and it's importance in general.  
 A: Convex functions have numerous applications. They are used for proving some inequalities in easy manner. They also have many applications in Operation Research, Quadratic and Geometric programming problems, etc.
A: If we speak more generally about convex functions at convex domains in $\mathbb{R^n}$ ($n\geqslant 1$), then this kind of functions has some very nice properties concerning the optimization tasks. At least, it can be proven that every local extremum is also a global extremum and there exists only one such extremum.
A: Convex analysis has proven that in a certain sense, convexity is the next best thing to linearity. Basically, as soon as you allow inequalities in linear setting, you are immediately in the territory of convex analysis. So convexity arises naturally in the study of dual spaces and weak topologies. In fact, there is a tendency to give the name "convexity" to anything that is nicely compatible with variational minimization problems. On another note, convexity and monotonicity are two sides of the same coin. Importance of monotonicity is something that does not need too much convincing. This link has been exploited e.g. in nonlinear PDEs, such as the Monge-Ampere equations.
A: Convex functions are particularly easy to minimise (for example, any minimum of a convex function is a global minimum). For this reason, there is a very rich theory for solving convex optimisation problems that has many practical applications (for example, circuit design, controller design, modelling, etc.), see here and here.
I can't remember who's quote this is, or exactly what the quote was, but it basically stated that (EDIT: thanks to Rahul Narain for providing the correct quote now included below):

"In fact the great watershed in optimization isn’t between linearity and nonlinearity, but convexity and nonconvexity." R.T. Rockafellar, "Lagrange Multipliers and Optimality", SIAM Review, 1993.

Aside: I first heard the above paraphrased in a lecture where the speaker (I can't remember who) also mentioned that researchers in the Soviet Union caught onto the above much sooner than western researchers (I can't vouch personally whether this is true or not).
A: Here is a cool example of convexification of a function having an important application: Behcet Acikmese, a current professor at UT Austin, worked at JPL (NASA subset) and developed GNC algorithms. His research developed a fundamental result, known as "lossless convexification", that provides the solution of a general class of nonconvex optimal control problems via computationally tractable convex optimization methods. The algorithm calculated a fuel-optimal trajectory from a current state to a given position, and does so by taking what was once a nonconvex problem and "convexifying" the solution space. Under certain constraints, this will always yield a solution that is inside the original feasible set. I don't know the gory details, but I had a chance to talk with Behcet about his work and the main point he stressed is that solving a convex problem on a computer is orders of magnitude faster than a nonconvex one, so being able to "convexify" the problem and still get an optimal, feasible answer is the holy grail of engineering problems.
A: Besides optimization problems (which have already been mentioned in other answers), one common way to make use of convexity is via Jensen's inequality, which has the following nice and concise statement:

"If $f$ is a convex function applied to a bunch of values $x_i$ and their mean $\bar x$, then the mean of the $f$s is greater than or equal to $f$ of the mean.  Also, if $f$ is strictly convex, the inequality is strict unless all the $x_i$'s are equal."

The reason this is so useful is that it turns out that, in probability theory, one quite often ends up comparing the averages of some set of values before and after applying a function, and the function quite often turns out, or can be arranged, to be (at least locally) convex.
For example, since the standard deviation of a distribution is the square root of its variance (which in turn is the mean of the squared distances from the mean), and since the square root function is concave, it follows from Jensen's inequality that the sample variance, being an unbiased estimator of the true variance, yields an underestimate of the standard deviation.
For another example, the arithmetic–geometric mean inequality follows directly from Jensen's inequality and the observation that the exponential function is convex (or, equivalently, that the logarithm is concave).
In fact, Jensen's inequality continues to hold even if the mean is replaced by any weighted mean (or, in other words, by any convex combination) of the values, provided that the values are weighted the same way before and after applying $f$.
This fact also has a nice geometric interpretation: if a set of points $(x_i,\,y_i)$ lie on the graph $y=f(x)$ of a convex function $f$, then their convex hull lies entirely above the graph and (assuming $f$ is strictly convex) intersects it only at the points $(x_i,\,y_i)$ themselves:

I at least find this connection between geometry and probability theory very elegant, not to mention often handy.
