The problem:
Let $f(x)$ be equal to $x^2+4$. Find an isomorphism $\phi: \mathbb{R}[x]/(f(x)) \rightarrow \mathbb{C}$
What I had in mind was to define:
$\phi(a_1x+a_0+(f(x)))=f(i)=a_1i+a_0$
However the correct answers are:
$\phi(a_1x+a_0+(f(x)))=2a_1i+a_0$
$\phi(a_1x+a_0+(f(x)))=-2a_1i+a_0$
I can't seem to find what is wrong with my definition, intuitively I think I have to consider the roots of $x^2+4$, but what exactly went wrong here?
Your morphism is not well defined. Let $I = (f(x))$. You send $x + I$ to $i$, but then $f(x^2 + I) = f(x + I)^2 = i^2 = -1$ while $f(x^2 + I) = f(-4 + I) = -4 \neq -1$. As you can see the other morphism sends $x$ to $2i$, which is well defined, as now $f(x^2 + I) = f(x + I)^2 = (2i)^2 = -4$.
Why you want to consider the roots of $x^2 + 4$ is as follows: You want $0 + I$ to be sent to $0 \in \Bbb C$ for your morphism to be well defined. Any element $g + I = 0 + I$ is in the ideal $I$, so is a multiple of $f$. So if we manage to send $f$ to zero our morphism is well defined. Of course if we want $f = x^2 + 4$ to be zero, we should send $x$ exactly to a root of $x^2 + 4$. We can choose either $2i$ or $-2i$ for this.