Construct a simple polynomial $f(x)$ of degree bigger than $1$ that has coefficients in some field $k$ and is irreducible over $k$, but is neither separable nor purely inseparable over $k$.
My approach:
Consider a polynomial $p(x)=(x-1)(x-2)(x-3)+1\in \mathbb{Q}[x]$. Using rational root test we can show that it has no roots in $\mathbb{Q}$ and hence is irreducible over $\mathbb{Q}$.
Since $p(x)=x^3-6x^2+7x-5$ then $p'(x)=3x^2-12x+7$ and we can check that $\text{gcd}(p,p')\neq 1$ because long-division shows that $p=p'\times(\frac{x}{3}-\frac{2}{3})+(-\frac{10x}{3}-\frac{1}{3})$. Hence $p(x)$ is not separable.
Also $p(x)$ is not purely inseperable. Otherwise $p(x)=(x-\beta)^3$ but comparing coefficients and expansion will give us a contradiction.
Question: Can anyone give another example in finite fields? I was trying to construct such example in finite fields but was not able to do it.
[From a discussion in the comments, by request. Not a true answer]
What is the greatest common divisor of $x^3-6x^2+7x-5$ and its derivative $3x^2-12x+7$, over $\mathbb{Q}$?
We run the Euclidean algorithm. Our first step is $p_0(x)=x^3-6x^2+7x-5$, and our second is $p_1(x)=3x^2-12x+7$. For convenience, normalize to a monic polynomial $p_1^*(x)=x^2-4x+\frac73$. Then divide: $$(x-2)p_1^*(x)=x^3-6x^2+(\tfrac73+8)x-\tfrac{14}{3}$$ $$p_0(x)=(x-2)p_1^*(x)+\left(-\frac{10}{3}x-\frac13\right)$$ That's our next remainder; $p_2(x)=-\frac{10}{3}x-\frac13$, and we normalize to $p_2^*(x)=x+\frac1{10}$. And now, the next step: $$(x-\tfrac{41}{10})p_2^*(x)=x^2-4x-\tfrac{41}{100}$$ $$p_1^*(x) = (x-\tfrac{41}{10})p_2^*(x) + \left(\frac73+\frac{41}{100}\right)$$ That's our remainder $p_3=\frac{823}{300}$, normalized to $p_3^*=1$. Then, of course, $p_2^*(x)=(x+\frac1{10})p_3^*(x)+0$, and the algorithm terminates.
The GCD is a constant. Since we're working over $\mathbb{Q}$, we might as well normalize that constant to $1$. Your long division wasn't wrong - it was just very incomplete.