This is a rather simple question that made me curious while studying basic geometry. In Hardy's number theory book, a region is convex if it is possible, through every point $P$ in the boundary - to draw at least one line $l$ such that the whole of the region lies on one side of $l$. On the other hand, a function $f:\mathbb{R}\rightarrow\mathbb{R}$ is convex if $\forall x_{1},x_{2}\in X,\forall t\in [0,1]: f(tx_{1}+(1-t)x_{2})\leq tf(x_{1})+(1-t)f(x_{2})$ according to Wikipedia.
Now, $f(x)=-x^2$ is not convex in the second definition, but I think the region bounded by the function is convex is the first definition. I want to ask how the two definitions of convexity are related (if at all) and where the seeming disparity of the observation above stems from. Any insight into the topic of convexity would be much appreciated.
There are two slightly different ideas here. Just sticking to intuitive ideas:
Convex set or region: in a sense the points on a line segment joining any two points in the set lies in the set. I think Hardy's version that you quote is equivalent in two dimensions
Convex function: in a sense the points on or above the graph of a function form a convex set. I think your definition from Wikipedia is equivalent
In your example of $f(x)=-x^2$, the points on or below the graph of the function form a convex set, and that is in fact the definition of a concave function