Prove that a graph on $n$ vertices with girth $g$ has at most $\frac{g}{g-2}(n-2)$ edges I'm not sure how to go about this. One of my thoughts was to take the number of edges in a complete graph, and subtract all of the edges that would be needed to make a smaller cycle. 
If you have $C_5$, there is only one way to make a $5$-cycle on $5$ vertices, but there's $10$ ways to make a $3$-cycle, and...
I have no idea how to do this without counting things multiple times. 
 A: This isn’t true as stated: the Petersen graph has $10$ vertices, $15$ edges, and girth $5$, and
$$15>\frac{40}3=\frac53(10-2)\;.$$
It is true for planar graphs. 
HINT: Use Euler’s formula, $v-e+f=2$, where $v,e$, and $f$ are the numbers of vertices, edges, and faces, respectively, of a planar graph when it is embedded in the plane without any edge intersections.
If that’s not enough, here’s a further hint:

 Count each edge once for each face in which it appears. Do this in two different ways, once by edges and once by faces, to get an inequality involving $e,f$, and $g$, and then use Euler’s formula to eliminate $f$. Finally, solve the inequality for $g$.

And the complete solution, bar a bit of algebra at the end.

 Each face has at least $g$ edges. If you count each edge once for each face in which it appears, you get $2e$ when you count by edges, since each edge appears in $2$ faces, and you get a minimum of $gf$ when you count by faces. Thus, $2e\ge gf=g(2-v+e)$. Now solve this inequality for $e$.

