Given an extension $1 \to N \to P \to Q \to 1$ of p-groups. Is it true that 
$$\dim H^\ast(P,\mathbb{F}\_p) = \dim \text{im}(res^P\_N) + \dim \text{im}(inf^P\_Q)$$
where $\dim$ denotes the Krull dimension, $res$ the restriction and $inf$ the inflation homomorphism ? 


Note that the image of the restriction resp. inflation is just the fibre resp. base in the $E\_\infty$ term of the Hochschild-Serre spectral sequence of the extension. 


This formula holds for abelian p-groups and I also checked it for various extensions of groups of order $p^3$ like Quaternion group and Dihedral group. 



Dimension of the cohomology ring of an extension of groups 
No, this isn't true in general. Let $P=N \ltimes Q$. Then $inf^P\_Q$ is injective, so $\dim \text{im}(inf^P\_Q) = \dim H^\ast(Q,\mathbb{F}\_p)$. By a theorem of Evens, $H^\ast(N,\mathbb{F}\_p)$ is finitely generated as module over $\text{im}(res^P\_N)$. Hence 
$\dim \text{im}(res^P\_N) = \dim H^\ast(N,\mathbb{F}\_p)$. Moreover, by a theorem of Quillen, the Krull dimension of the mod-p cohomology ring of a finite group is equal to the p-rank $r\_G$ of $G$. So your claim is in the semi-direct product case:
$$r\_G = r\_N + r\_Q.$$
Now a counterexample is given by the extraspecial p-group of order $p^3$: 
$$P=\langle x,y,c\mid x^p=y^p=c^p=[x,c]=[y,c]=1,[x,y]=c\rangle$$
$$N =\langle x,c\rangle \cong (\mathbb{Z}/p)^2,\quad Q=\langle y\rangle \cong \mathbb{Z}/p$$
where $r\_P=2, r\_N=2,r\_Q=1$. 


