We have a decision variable $0<y<1$ and the following constraint $$z=\frac{y^2-y+1}{y(1-y)},\tag{1}$$ We also have another constraint $$y=f(x),\tag{2}$$ where $f(x)$ is a linear function of $x$.
In other words, our primary decision variable is $x$.
$y$ and $z$ are auxiliary decision variables.
We would like to linearize constraint (1) by replacing it with its piece-wise linear approximation.
How can we do that?
If we divide the interval $(0,1)$ into $n$ pieces of equal length (assuming we know what the "best" $n$ is) and denote each piece by $r_i, i=1,\ldots,n$, define a new decision variable $w_i=1$ if and only if $y$ is in the $i$th interval and $w_i=0$ otherwise, then can we linearize (1) as $$z=\sum_{i=1}^{n}\left(\frac{r_i^2-r_i+1}{r_i(1-r_i)}\right)w_i$$
Does this make sense? If so, since we are talking about an interval $r_i$, which point in that interval is going to be the value of $r_i$?
Do we need to add another constraint as $$\sum_{i=1}^{n}w_i=1,$$ so we guarantee that $y$ is in one of those intervals?