I need help showing the following:
Prove that the function $$f:\mathbb{R}\to\mathbb{C},\quad f(t)=\begin{cases}e^{it},&t\geq0,\\1+it,&t<0,\end{cases}$$ is continuous everywhere.
I would try to show that $\lim\limits_{x \to 0^{-}} f(x) = \lim\limits_{x \to 0^{+}} f(x) = f(0)$.
However, this problem is different from the ones I usually did (because of the complex parts). My first idea was to simply insert $t=0$ and get $1=1=1$ since $e^{i0}=1$ and $1+i*0 = 1$. This seems to be way too easy and I am not sure whether I am allowed to do so because of the mapping $\mathbb{R} \to \mathbb{C}$. Do I have to consider the cases limit approaching real and imaginary axis separately? I notice that I can convert $e^{it} = cos(t) + isin(t)$ but don't see if and how this could help towards the solution.
The second part of the problem is to show $g:(-\infty,1] \to \mathbb{R}, t \to e^t |f(t)|^2$ has a global maximum in $x_0=1$. I honestly have absolutely no clue where to start or how to do this at all. How do I square a piecewise function? And what does it mean to map $t$ to the squared function? I believe I could use extreme value theorem because $f(t)$ is continuous, so composition of $e^t*f(t)^2$ should be continuous as well? But the interval of $g$ is not closed, can I simply take any value $x<1$ since $g$ is continous everywhere?
I know that what I've tried is not really satisfying, but I don't even know where to start and I'd be thankful for every hint on how to tackle this and what I can and can't do with these kinds of problems.
For the continuity at the origin, it is, as you say, sufficient to use the continuity of the functions on each side (assuming we already know these are continuous, that is) and compute that
$$\lim_{x\to0^+}f(x)=\lim_{x\to0^+}e^{ix}=1,$$
$$\lim_{x\to0^-}f(x)=\lim_{x\to0^-}(1+ix)=1,$$
from which we get that
$$\lim_{x\to0}f(x)=1=e^{i0}=f(0),$$
and so $f$ is continuous at the origin.
Before moving on, let me also comment on your question about whether you have to consider the real and imaginary parts separately. The answer to that is no, you don't have to, and you can prove complex limits without considering real and imaginary parts, however it is true that $f(x)\to z$ if and only if $\Re(f(x))\to\Re(z)$ and $\Im(f(x))\to\Im(z)$, and some times it is easier to work with the real and imaginary parts separately, but not always. Indeed for example, you could prove that $t\mapsto e^{it}$ is continuous by splitting up into real and imaginary parts and showing that those are continuous.
Now for your second part of the problem, you are considering the function
$$g:(-\infty,1]\to\mathbb{R},\quad x\mapsto e^x\lvert f(x)\rvert^2.$$
To figure out what this function is more explicitly, we have to realize that function composition is done pointwise, and so to find $\lvert f\rvert^2$, we take the modulus and square it at each point. But we have explicit expression for $f$ at each point, and so what we get is that for $x\in[0,1]$,
$$g(x)=e^x\underbrace{\lvert e^{ix}\rvert^2}_{=1}=e^x,$$
and for $x\in(-\infty,0)$,
$$g(x)=e^x\lvert 1+ix\rvert^2=e^x(1+x^2).$$
So we have that
$$g(x)=\begin{cases} e^x,&x\geq0,\\ e^x(1+x^2),&x<0. \end{cases}$$
Now notice that $g$ is differentiable with derivative given by
$$g'(x)=\begin{cases} e^x,&x\geq 0,\\ e^x(1+x)^2,&x<0. \end{cases}$$
I'll leave it to you to verify this fact. We can then immediately see that $g'(x)\geq0$ for all $x\in(-\infty,1]$, and so $g$ is an increasing function. This immediately implies that $g$ attains its global maximum at $x=1$, and so we are done.