For each of the mappings f given in Excercise 1, determine whether f has a left inverse. Exhibit a left inverse whenever one exists

b. $\displaystyle f(x) = 3x$

I know the function is one to one and has a left inverse as follows

$\displaystyle \begin{array}{rl}

f(m) = f(n) \implies & 3m = 3n\\

\implies & m = n \end{array}$

Based on the lemma we have (lemma 1.24 in our book we know the following)

If there is an element $\displaystyle y \in Z$ such that $\displaystyle f(y)=x$, then $\displaystyle g(x)= y$.

$\displaystyle f(x) = 3x$

$\displaystyle f(y) = 3y$

$\displaystyle x = 3y$

$\displaystyle \frac{x}{3} = y$

$\displaystyle g(x) = \frac{x}{3}$

Now I know that is the inverse of the function but is that the inverse only when x is a multiple of 3? and it's an arbitrary $\displaystyle a_{0}$ for all other conditions? How would I write that ...

A left inverse $\displaystyle g: Z \rightarrow Z$ is $\displaystyle \[ g(x) = \left\{ \begin{array}{ll}

\frac{x}{3} & \mbox{if x is a multiple of 3}\\

1 & \mbox{if x is not a multiple of 3}\end{array} \right. \]$

As you can see the problem is essentially solved it's more or less how do I format my answer that would be expected by a professor when I take this course next semester.