3. Let $x$ be a positive real number, then the minimum value of the function $y=x^{2}-x+\frac{1}{x}$ is $\qquad$ .
3. 1.

The formula yields
$$
\begin{aligned}
y & =(x-1)^{2}+x+\frac{1}{x}-1 \\
& =(x-1)^{2}+\left(\sqrt{x}-\frac{1}{\sqrt{x}}\right)^{2}+1 .
\end{aligned}
$$

When $x=1$, both $(x-1)^{2}$ and $\left(\sqrt{x}-\frac{1}{\sqrt{x}}\right)^{2}$ simultaneously take the minimum value of 0, so the minimum value of $y=x^{2}-x+\frac{1}{x}$ is 1.