Prove correctness of this (context-free) grammar
Now how can you justify the correctness of this grammar?


In order to prove that some grammar $G$ generates a language $L$, i.e. $L= L(G)$, you need to prove two things:


for any string $w \in L$, $G$ yields/generates $w$, i.e., $S \Rightarrow^* w  $, and
for any string $w$ (consisiting of only terminal symbols), if $G$ yields/generates $w$, then $w \in L$


In your particular example, you first need to prove that if $w$ has twice as many $a$s than $b$s then your grammar $G$ yields $w$, and if $G$ yields some string $w$ then $w$ has twice as many $a$s than $b$s. Induction on the length of $w$ or the number of steps of application of derivation rule might be helpful.

This is our reference question which may be helpful to prove that a language is context free.