Functional equation with the property $P(x+1)=P(x)+2x+1$

Let $P$ be a solution, and let $Q(x)=P(x)-x^2$. Then $Q(x+1)=Q(x)$. Thus, $Q(x)-Q(0)$ is zero at all integer values of $x$. A nonzero polynomial of degree $n$ has at most $n$ roots, hence $Q(x)-Q(0)=0$ identically, and $P(x)=x^2+P(0)$.


You can solve even more general problem:

Problem. For given polynomial $Q(x)$ find all polynomials $P(x)$ such that $P(x+1)-P(x)=Q(x)$.

Solution. Firstly, note that if $Q(x)\equiv 0$, then the only solution is $P(x)\equiv c$ for some real $c$. Now, suppose that $Q(x)=q_mx^m+\ldots+q_1x+q_0$, where $q_i\in\mathbb{R}$ and $q_m\neq 0$. If $P(x)=p_kx^k+\ldots+p_1x+p_0$ and $p_k\neq 0$, then we have $$ P(x+1)-P(x)=Q(x), $$ which is equivalent to $$ p_k((x+1)^k-x^k)+\ldots+p_1((x+1)-x)=q_mx^m+\ldots+q_1x+q_0, $$ or $$ \binom{k}{k-1}p_{k}\cdot x^{k-1}+\left(\binom{k}{k-2}p_{k}+\binom{k-1}{k-2}p_{k-1}\right)\cdot x^{k-2}+\ldots+\left(\binom{k}{0}p_{k}+\binom{k-1}{0}p_{k-1}+\ldots+\binom{1}{0}p_{1}\right)\cdot 1=q_mx^m+\ldots+q_1x+q_0 $$ Since it holds for all $x$ we have $m=k-1$ and the following linear system: $$ \begin{cases} \binom{k}{k-1}p_{k}&=q_{k-1} \\ \binom{k}{k-2}p_{k}+\binom{k-1}{k-2}p_{k-1}&=q_{k-2} \\ \ldots \\ \binom{k}{0}p_{k}+\binom{k-1}{0}p_{k-1}+\ldots+\binom{1}{0}p_{1}&=q_0 \end{cases} $$ From this system we can find $p_{k},p_{k-1},\ldots,p_{1}$. Hence, the resulting polynomial $P(x)$ will be unique up to constant $p_0$ (and that's because $P(x+1)-P(x)=(P(x+1)+c)-(P(x)+c)$).

Applying this for your problem we obtain that $P(x)=x^2+c$.