Determine the $\gcd$ and $\text{lcm}$ of $\,n^{2}+1$ and $\,n(n^{2}-1)$
My attempt :
Let: $\ d\mid n^{2}+1 $ and $\,d\mid n(n^{2}-1) $
Then: $\ d\mid n(n^{2}+1)-n(n^{2}-1) = 2n$
For example: $n=2$ then $d=1$ ??
$n=3$ then $d=2$
I'm correct or no ??
And what about $\text{lcm}$ ??
Hint: $\ (\color{#c00}{n^2\!+\!1,n)=1}\,$ so $\,(\color{#c00}{n^2\!+\!1,n}(n^2\!-\!1)) = (n^2\!+\!1,n^2\!-\!1) = (2,n^2\!-\!1) = (2,n\!-\!1)$
Finally, recall that the lcm is the product over the gcd $ = (n^5-n)/(2,n\!-\!1).\,$ Your inference is correct but you need to go further as above to obtain the gcd.