Let G be a planar graph with n vertices, e edges and girth $g<\infty$. I am aware that if g is connected then we can use Euler's formula to get the following inequality: $$e \leq \frac{g(n-2)}{g-2}$$ Would this inequality hold if G is not connected and instead has k connected components?
Thanks in advance.
If $G$ has $k$ connected components, then you can deal with each of them separately. If the $i^{\text{th}}$ component has $n_i$ vertices and $e_i$ edges, then $$ e_i \le \frac{g(n_i-2)}{g-2} = \frac{g}{g-2} n_i - \frac{2g}{g-2}$$ by the identity you quote, and therefore $$ e = \sum_{i=1}^k e_i \le \sum_{i=1}^k \left(\frac{g}{g-2} n_i - \frac{2g}{g-2}\right) = \frac{g}{g-2}n - \frac{2kg}{g-2}. $$ The inequality we get this way is an even tighter bound, so in particular the original inequality still holds for $G$.
Another way to see in advance that the inequality will be tighter is that if $G$ has $k$ connected components, then we can join them by $k-1$ edges without creating any new cycles. The new graph $G'$ has more than $e$ edges, but is a connected graph with girth $g$, so applying the bound to $G'$ gives us an inequality for $G$ as well. (But the previous method gives us the optimal inequality for $G$, in terms of $k$.)