Let $X = C[−1,1]$ be the space of continuous functions $f : [−1,1] → \mathbb R$. For $f,g ∈ X$ define
$$\langle f,g\rangle =\int_0^1 f(t)g(t)dt$$
If I choose $f(t)=-t$ and $g(t)=1$, then $\langle f,g\rangle$ would be negative so it wont be an inner product.
Is this correct?
Your answer is incorrect. $\langle f,g \rangle$ is allowed to take any value, but $\langle f,f \rangle$ must be non-negative. Try to come up with an example of two vectors whose dot-product is negative, noting that the dot-product is the prototypical inner product.
The property of inner products that fails here is that $$ \|f\|^2 = \langle f,f \rangle = 0 \iff f = 0 $$ try to find a non-zero (continuous) $f$ whose norm is zero.
Answer (as given by asker in the comments): $$ f(x) = \begin{cases} x & x \in [-1,0)\\ 0 & x \in [0,1] \end{cases} $$ is such a function.