Let's integrate $\int\frac{f^\prime(x)}{f(x)} dx$ by parts $$ \\ \mbox{ Let } dv= f^\prime(x)dx,u=\frac{1}{f(x)} \\ \mbox{ Then }v=f(x), du=-\frac{f^\prime(x)}{[f(x)]^2}dx \\ \mbox{ This implies }\int\frac{f^\prime(x)}{f(x)}dx = f(x) \frac{1}{f(x)} - \int -f(x)\frac{f^\prime(x)}{[f(x)]^2}dx \\ \mbox{ after simplifying } \int\frac{f^\prime(x)}{f(x)}dx = 1 + \int \frac{f^\prime(x)}{f(x)}dx \\ \mbox{ subtracting the integral from both sides } \\0 = 1$$
How do we teach integration by parts properly so that this isn't what students think is correct?
You are solving for a $\textit{class}$ of functions when you compute an indefinite integral. Meaning when you compute an indefinite integral as follows, where $F'=f$ and $G'=g$ $$f=g\Rightarrow \int f=\int g +c \\\Rightarrow F=G+c$$ The function $F$ is the same as the function $G$ $\textit{up to a constant}$