If $p$ is a prime number and $P \in \mathbb{F}_p[T] = A$ is irreducible, show $(A/ \langle P^2\rangle)^*$ is cyclic if and only if $\deg(P) = 1$.
I'm stuck on the $(\implies)$ direction. Let $(A/ \langle P^2\rangle)^* = \langle f \rangle$, $n = \deg(P)$. By the analogue of Fermat's little theorem and the fact that $f$ generates a group of order $p^n(p^n-1)$, we have that \begin{align*} f^{p^n - 1} \equiv 1 &\mod P \\ f^{p^n} \equiv f &\mod P \\ f^{p^n(p^n-1)} \equiv 1 &\mod P^2. \end{align*} I feel like this is what should give me the result since (unless I am mistaken) these three congruencies only happen when $(A/\langle P^d \rangle)^*$ is cyclic with $d=2$ (this is because $|(A/\langle P^d \rangle)^*| = p^{n(d-1)}(p^n - 1)$). Is this the right idea?
Let $\deg(P)=n$. Then $A/(P)\cong{\Bbb F}_{p^n}$ because $A/(P)$ is an extension of $\Bbb F_p$ of degree $n$.
Now if $(A/(P^2))^*$ is cyclic, let $f$ be a generator. We can write $f$ as $f=f_1+f_2P$ by Euclidean division, where $\deg(f_1)<n$. Then $$f_1^{p^n-1}=1+gP$$ since $\Bbb F_{p^n}^*$ is of order $p^n-1$.
Note that $f^{p^n-1}=f_1^{p^n-1}+hP=1+h'P$ for some $h,\,h'$. Thus $$f^{p(p^n-1)}=(1+h'P)^p=1+(h'P)^p=1,$$ where the second equality is because $(a+b)^p=a^p+b^p$ in $\Bbb F_p[T]$, and the third because $p\geq2$.
This means the order of $f$ must divide $p(p^n-1)$. But the order of $A/(P^2)$ is $p^n(p^n-1)$ as you observed, so we conclude that $n\leq1$.
Hope this helps.