Ambiguity Problem (Language Structures)
The language of the grammar $G$ presented here is regular and its corresponding regular expression is
$$r = (a \mid b)^*aa(a \mid b)^*.$$
Now, convert the regular expression to a minimal finite automaton and use this question to convert the automaton to an unambiguous regular grammar, which is always possible.
In the end you can get something like this:

$$
\begin{align}
S &amp;\rightarrow aA \mid bS \\
A &amp;\rightarrow aB \mid bS \mid a \\
B &amp;\rightarrow aB \mid bB \mid \epsilon
\end{align}
$$



Proof that $\mathscr{L}(r) = \mathscr{L}(G)$: (1) Let $s \in \mathscr{L}(r)$, hence $s = x aa y$, where strings $x,y$ consist of characters $x_i, y_j \in \Sigma, i = [1..m], j = [1..n], m = |x|, n = |y|$.
There is a derivation of $s$:
$$S \rightarrow x_1S \rightarrow x_1x_2S \rightarrow ... \rightarrow x_1...x_mS = xS \rightarrow xSy_n \rightarrow xSy_{n-1}y_n\rightarrow ... \rightarrow xSy_1...y_n = xSy \rightarrow xaay.$$
Thus $s = xaay \in \mathscr{L}(G)$ and $\mathscr{L}(r) \subseteq \mathscr{L}(G)$.

(2) Let $s \in \mathscr{L}(G)$. This means there exists some derivation
$$S \rightarrow \alpha_1 \rightarrow \alpha_2 \rightarrow ... \rightarrow \alpha_p = s.$$
Observe that the only way to make the non-terminal $S$ disappear is to use the rule $S \rightarrow aa$ and it must be the last step of the derivation:
$$S \rightarrow \alpha_1 \rightarrow ... \rightarrow \alpha_{p-1} = xSy \rightarrow \alpha_p = s = xaay,$$
where $x,y$ are some strings of terminals.
Thus $s = xaay \in \mathscr{L}(r)$ and $\mathscr{L}(G) \subseteq \mathscr{L}(r)$, resulting in $\mathscr{L}(G) = \mathscr{L}(r)$. Qed.