Find sequence function and general rule the function $$a_{n+2}=3a_{n+1}-2a_n+2$$
is given, and $$a_0=a_1=1, (a_n)_{n\ge0}$$
multiplying everything by $$/\sum_{n=0}^\infty x^{n+2}$$
also adding $$\sum_{n=0}^\infty (a_{n+2}x^{n+2}+a_1x+a_0)-a_1x-a_0=\sum_{n=0}^\infty (3a_{n+1}x^{n+2}+a_0)-a_0-\sum_{n=0}^\infty 2a_nx^{n+2}+\sum_{n=0}^\infty 2x^{n+2}$$
we get $$R(X)-2x-1=3x(R(X)-1)-2x^2R(X)+\frac{2x^2}{1-x}$$
$$R(X)(1-3x+2x^2)+x-1=\frac{2x^2}{1-x}$$
$$R(X)(1-3x+2x^2)=\frac{3x^2-2x+1}{1-x}$$
$$R(X)=\frac{3x^2-2x+1}{(1-x)^2(1-2x)}=\frac{A}{(1-x)^2}+\frac{B}{1-2x}$$
so $$3x^2-2x+1=A(1-2x)+B(1-x)^2$$
$$3x^2-2x+1=x^2(B)+x(-2A-2B)+A+B$$
B=3
-2A-2B=-2
A+B=1$$\quad\Longrightarrow\quad A=-2, B=3$$
$$R(X)=\frac{-2}{(1-x)^2}+\frac{3}{1-2x}=-2\sum_{n=0}^\infty nx^{n-1}+3\sum_{n=0}^\infty (2x)^2=$$
how to proceed?

$a_{n+2}=3a_{n+1}-2a_n+2$, $a_0=a_1=1$
Doing it the more pedestrian way, you would first find the basis solutions of the homogeneous equation that are geometric progressions, $a_n=q^n$. This is the case if
$$
q^2=3q-2\iff 0=(q-1)(q-2), 
$$
so that the general homogeneous solution is
$$
a_n=C+D\,2^n
$$ 
Since the inhomogeneity is also a constant, the ansatz of similar type is $a_n=A\,n$, resulting in the equation
$$
A(n+2)=3A(n+1)-2An+2\iff -A=2\iff A=-2
$$
so that the general solution of the inhomogeneous recursion has the form
$$
a_n=-2n+C+D\,2^n
$$
Checking the initial conditions gives
$$
1=C+D=-2+C+2D\iff 0=-2+D\land C=-D+1\iff D=2\land C=-1
$$
so finally
$$
a_n=-(2n+1)+2^{n+1}.
$$
