If your function f(x) is indeed f(x) = -2+2, then f(x) = 0, which would be a horizontal line superimposed on the x-axis. In that case any vertical like would be perpendicular to it. A vertical line would have the same x-value and thus would be a constant value as a function of y. The solution then would be f(y) = 3, a vertical line located at x = 3.
https://www.desmos.com/calculator/cbjy2vviqn
However, and I suspect this to be the more likely case, if your function f(x) is actually f(x) = -2x +2, then any line with the the inverse for m (slope) of your original function would be perpendicular. Since m = -2, any function with a slope of m = 1/2 would be perpendicular to it.
Now you can use the Point-Slope Form to get the equation for a perpendicular line going through P(3;1).
y - y1 = m ( x - x1 )
y - 1 = 1/2 (x - 3)
y - 1 = x/2 - 3/2
y = x/2 - 1/2
https://www.desmos.com/calculator/xepmawsl5v