The following proof uses the "Cayley-Hamilton trick":
Let $x_1,\cdots,x_n$ generate $I$ as an $A$-module. Since $I=I^2$, we can write: $x_i=\sum\limits_{i=1}^{n} a_{ij}x_j$ for $1\leq i\leq n$ and $a_{ij}\in I$ for all $1\leq i\leq n$, $1\leq j\leq n$. In particular, the matrix $M=[\delta_{ij}-a_{ij}]_{1\leq i\leq n,1\leq j\leq n}$ ($\delta_{ij}$ denotes the Kronecker delta) annihilates the column vector $x=[x_j]_{1\leq j\leq n}$. If we multiply both sides of the matrix equation $Mx=0$ by the classical adjoint of $M$, we obtain an element of the form $1-e$ for $e\in I$ (the determinant of $M$) that annihilates every $x_i$. Hence $(1-e)I=0$. Clearly, this implies that $I=eA$ and $e^2=e$.
I propose the following: suppose $\,U\,$ is not prime, thus there exist $$\,x,y\in R \text{ such that }x,y\notin U\,,\,xy\in U\,.$$ Define now $B:=U+\langle y\rangle$.
By maximality of $\,U\,$ we have that $\,B\,$ is f.g., say $$\,B=\Bigl\langle u_i+r_iy\,,\,1\leq i\leq k\,,\,k\in\mathbb{N}\,\,;\,\,u_i\in U\,,\,r_i\in R\Bigr\rangle$$ and let now $$U_y:=\{s\in R\,\,;\,\,sy\in U\}.$$ (1) Check that $\,U_y\,$ is a proper ideal in $\,R\,$.
(2) Show that $\,U_y\,$ is f.g.
Put $\,U_y=\langle s_1,\ldots,s_m\rangle\,$, and take $\,u\in U\Longrightarrow\,\exists v_1,\ldots,v_k, t_1,\ldots,t_k\in R\,\,s.t.$$$u=\sum_{n=1}^kv_nu_n+\sum_{n=1}^kt_nr_ny.$$
(3) Show that $\displaystyle{\sum_{n=1}^kt_nr_n}\in U_y.$
(4) Putting $\,\Omega:=\{u_i,\ldots,u_k,ys_1,\ldots,ys_m\}\,$, derive the contradiction $\,U=\langle\Omega\rangle$.
Best Answer
Let $k$ be a field and $A=k\times k\times ...$ the product of denumerably many many copies of $k$.
Let $I\subset A$ be the ideal of eventually zero sequences and $\mathfrak m\supset I$ a maximal ideal containing it.
Since in $A$ every element $a$ is multiple of $a^2$, we certainly have $\mathfrak m=\mathfrak m^2$ but $\mathfrak m$ is not finitely generated: else it would be generated by an idempotent ( by Nakayama ).
Edit
Since the OP has edited his question, requesting an example with a local ring, here is such an example.
Consider the domain $A=\mathbb Q[X^{1/n}|\; n=1,2,\cdots]$ consisting of "polynomials" over a field $k$ with positive rational exponents, and its maximal ideal $M=\langle X^{1/n}|n=1,2,\cdots\rangle\subset A$.
Obviously $M=M^2$.
If we now localize at $M$ we get the required local ring $R=A_M$, with maximal ideal $\mathfrak m=MA_M$.
Indeed, $\mathfrak m=\mathfrak m^2$ is clear and that ideal is not finitely generated: the simplest argument is again that if it were, it would be generated by a single idempotent element (Nakayama).
But this is impossible, because $R$ is a domain and thus has only $1$ and $0$ as idempotents.