Define $f(x)$ to be $1$ when $1 ≤ x < 2$ and $-1$ when $2 ≤ x ≤ 3$.
Then the integral is equal to:
$$\int_1^2 \frac{f(x)}{x} \mathrm d x + \int_2^3 \frac{f(x)}{x} \mathrm d x$$
$$= \int_1^2 \frac{1}{x} \mathrm d x + \int_2^3 \frac{-1}{x} \mathrm d x$$
$$= [\ln x]_1^2 + [-\ln x]_2^3$$
$$= (\ln 2 - \ln 1) + (- \ln 3 + \ln 2)$$
$$= \ln 4 - \ln 3 = \ln \left( \frac{4}{3} \right)$$
This is most likely the function that gives the greatest value. For constant functions, adjusting where the function 'breaks', and the number in the constant function does not seem to give an answer greater than this.
The requirement that $\int_1^3 f(x) \mathrm d x = 0$ is to make sure that $f(x)$ cannot be equal to $1$ within the interval. Otherwise you can use the argument that the integral is bounded above by $\int_1^3 \ln x \ \mathrm d x = \ln 3$.