<s>[INST] $abc+a+b+c=ab+bc+ca+5,$ $a, b, c \in \mathbb{R}$. Find the minimum of $a^2+b^2+c^2$. 
$abc+a+b+c=ab+bc+ca+5,$ $a, b, c \in \mathbb{R}$. Find the minimum of $a^2+b^2+c^2$.

I will let $\displaystyle \sum_{c} = \sum_{cyc}.$
$\displaystyle \sum_c a^2 - \sum_c ab = \frac 1 2 \bigg( \sum_c(a-b)^2 \bigg) \geq 0.$
$\displaystyle \sum_c a^2 \geq \frac {\displaystyle \bigg(\sum_c a \bigg)^2}{3}$.
$\displaystyle \bigg( \sum_c a^2 \bigg) \bigg( \sum_c b^2 \bigg) \bigg( \sum_c c^2 \bigg) \bigg( \sum_c a^2b^2c^2 \bigg) \geq \bigg( \sum_c abc \bigg)^4.$
$\therefore \displaystyle \bigg( \sum_c a^2 \bigg)^3 \geq 27a^2b^2c^2.$
Let $a+b+c=X$, $ab+bc+ca=Y$, $abc=Z$, $a^2+b^2+c^2=W$.
\begin{align}
& W \geq \dfrac {X^2} {3} & (1) \\
& W \geq Y & (2) \\
& W^3 \geq 27Z^2 & (3)
\end{align}
According to $(1)$ and $(3)$,
\begin{align} W^2 \geq 3XZ.& & (4) \end{align}
According to $(2)$ and $(4)$,
\begin{align} W \geq \sqrt [3] {3XYZ}. \end{align}
 [/INST] You have $(a-1)(b-1)(c-1)=4$ and you seek to minimise
$a^2+b^2+c^2$. WLOG let $a$ be the largest among $a,b,c$, then $x=a-1>0$.
$\begin{align}
a^2+b^2+c^2&=(a^2-2)+(b^2+c^2+1+1)\\
&\geqslant (a^2-2)+\tfrac14(b+c-1-1)^2\tag{CS inequality}\\
&\geqslant (x^2+2x-1)+(b-1)(c-1)\tag{$(p+q)^2\geqslant 4pq$}\\
&=\color{red}{x^2+2x+4/x}-1
\end{align}$
Now the univariate expression in red can be easily minimised using calculus or $7$-term AM-GM to get $a^2+b^2+c^2\geqslant 6$.
Equality is when $x=1,b=c=-1$ or in general when $(a,b,c)\sim (2,-1,-1)$ where $\sim$ denotes any permutation.
</s>