I'll start off with a disclaimer: this will be a long and technical answer. I'll take a risk that this might be much more technical than you asked for, but it can't be avoided if you are really looking for understanding this limit beyond just techniques to calculate it. If you simply want to know how it's calculated, I refer you to the link that peterwhy provided in the comments.
In fact, that's how I recommend anyone to calculate it. In this answer I do something else.
What I'll cover is usually done at university level at a first course in mathematical analysis, but I'll just stick to the stuff we need for this particular limit and will provide links that you can use if you are not familiar with something I use.
The whole point of this answer is to convince you that $\lim_{x\to 0}(1+x)^{\frac 1x}$ exists essentially because $\lim_n(1+\frac 1n)^n$ exists and those two are equal. If you are happy with just that as an explanation, you can read section 2. and ignore the rest of the answer.
1. Intro
First of all, as pointed out in the comments, to even consider the limit $\lim_{x\to 0}(1+x)^{\frac 1x}$, you'd need to define what $(1+x)^{\frac 1x}$ is for all real numbers $x$. What we use here is definition of $a^b = e^{b\ln a}$ (I discuss why we use such a definition in this answer if you are interested), so $(1+x)^{\frac 1x} = e^{\frac 1x \ln(1+x)}.$ From there, one can simply find out the limit just like I mentioned at the start, but I don't think this is a satisfying answer if one is not familiar with how exponential function is defined in terms of limits and the whole process of showing that the definition is good.
However, I will not use $(1+x)^{\frac 1x} = e^{\frac 1x \ln(1+x)},$ I'll just take for granted that such a function exists, but I'll use the same ideas one uses to establish definition of exponential function.
Concretely, one can define $e^x=\lim_n(1+\frac xn)^n$ for any real $x$ (this is not the only way one can define it), but I'll only consider the special case when $x=1$ (and later $x = -1$), which you are probably familiar with: $\lim_n(1+\frac 1n)^n = e\approx2.718,$ and then relate this to your limit.
2. Existence of $\lim_n(1+\frac 1n)^n$
So, let's start with a proof that $\lim_n(1+\frac 1n)^n$ exists. We do it by using monotone convergence theorem, i.e. we want to show that the sequence $(1+\frac 1n)^n$ is increasing and bounded above, therefore it is convergent.
To show that it is increasing we can use AM-GM inequality:
\begin{align}\sqrt[n+1]{(1+\frac 1n)^n} = \sqrt[n+1]{1\cdot(1+\frac 1n)\ldots(1+\frac 1n)}&\leq\frac{1+(1+\frac 1n)+\ldots+(1+\frac 1n)}{n+1}\\ &= \frac{1+n(1+\frac 1n)}{n+1} = 1+\frac 1{n+1}.\end{align} Applying $(n+1)$-st power to both sides gives us $(1+\frac 1n)^n \leq (1+\frac 1{n+1})^{n+1}$ for all positive integers $n$.
To show that it is bounded above we use binomial theorem:
\begin{align}(1+\frac 1n)^n = \sum_{k=0}^n\binom nk\frac 1{n^k} &= \sum_{k=0}^n\frac 1{k!}\frac{n(n-1)\ldots(n-k+1)}{n^k}\leq \sum_{k=0}^n\frac 1{k!} \\&= 1 + (1+\frac 1{2!}+\frac 1{3!}+\ldots+\frac 1{n!})
\\&\leq 1 + (1+\frac 1{2}+\frac 1{4}+\ldots+\frac 1{2^{n-1}}) = 1+\frac{1-\left(\frac 12\right)^n}{1-\frac 12}\\
&\leq 1+\frac{1}{1-\frac 12} = 3
\end{align}
where we also used formula for sum of finite geometric sequence and this finishes the proof that $(1+\frac 1n)^n$ converges to some number less than or equal to $3$. This is how one can define the number $e$: it is equal to that limit.
3. Towards $\lim_{x\to 0}(1+x)^{1/x}$
We are now ready to come back to the limit you asked about. You had a good idea by considering $\lim_{x\to\infty}(1+\frac 1x)^x$ instead, but it's not the full picture. You see, $\frac 1x$ approaches $0$ when $x$ goes to $\infty$, but only from above, so $\lim_{x\to\infty}(1+\frac 1x)^x = \lim_{x\to 0^+}(1+x)^{\frac 1x}$, where notation $x\to 0^+$ means that we are only considering positive $x$ approaching $0$ (see one-sided limit).
To calculate the limit you want we also need to see what happens when $x$ approaches $0$ from bellow. We can do it by calculating $\lim_{x\to -\infty}(1+x)^{\frac 1x} = \lim_{x\to 0^-}(1+\frac 1x)^x$. If this limit turns out to be the same as the last one, then we can conclude that $\lim_{x\to 0}(1+x)^{\frac 1x}$ exists and is equal to those two limits.
4. Existence of $\lim_{x\to\infty}(1+\frac 1x)^x$
To calculate a limit of a function at $\infty$, we consider all sequences $(x_n)$ of real numbers that tend to $\infty$ and need to show that $\lim_n(1+\frac 1{x_n})^{x_n}$ exists for all of them and all of those limits are equal (see limit of a function).
The idea here is that we already know that this limit exists in the case of $x_n = n$ and is equal to $e$. This is also true for any such sequence $(x_n)$ of integers, because in that case the sequence $(1+\frac 1{x_n})^{x_n}$ is a subsequence of the convergent sequence $(1+\frac 1n)^n$, and any subsequence of a convergent sequence converges to the same limit. We can actually use that to conclude that it's true for all sequences $(x_n)$ that tend to $\infty$, not just sequences of integers.
So let $(x_n)$ be such a sequence and for every $x_n$, and let $a_n$ be the unique integer such that $a_n \leq x_n < a_n+1$. We then have
$$1+\frac 1{a_n+1} \leq 1+ \frac 1{x_n} \leq 1 + \frac 1{a_n}$$ and $$\left(1+\frac 1{a_n+1}\right)^{a_n} \leq \left(1+ \frac 1{x_n}\right)^{x_n} \leq \left(1 + \frac 1{a_n}\right)^{a_n+1}.\tag{1}$$
The limit of the RHS sequence is $\lim_n(1 + \frac 1{a_n})^{a_n+1} = \lim_n (1 + \frac 1{a_n})^{a_n}\cdot\lim_n(1+\frac 1{a_n}) = e\cdot 1 = e$ and the limit of the LHS sequence is $\lim_n(1 + \frac 1{a_n+1})^{a_n} = \lim_n (1 + \frac 1{a_n+1})^{a_n+1}\cdot\lim_n(1+\frac 1{a_n})^{-1} = e\cdot 1^{-1} = e.$
By the squeeze theorem from $(1)$ it follows that $\lim_n(1+ \frac 1{x_n})^{x_n} = e$ for any sequence $(x_n)$ that tends to $\infty$, and therefore $\lim_{x\to\infty}(1+\frac 1x)^x = e$.
5. Existence of $\lim_{x\to -\infty}(1+\frac 1x)^x$.
I will make this as short as possible and just refer to what we previously proved. First note that $$\lim_{x\to -\infty}\left(1+\frac 1x\right)^x =\lim_{x\to \infty}\left(1-\frac 1x\right)^{-x} = \frac 1{\lim_{x\to \infty}\left(1-\frac 1x\right)^{x}}.$$
Now, by the same type of arguments as previously, $\lim_{x\to \infty}(1-\frac 1x)^{x}$ will be equal to $\lim_n(1-\frac 1n)^n$. To see that $\lim_n(1-\frac 1n)^n$ exists, we do the same as for $\lim_n(1+\frac 1n)^n$, we prove that $(1-\frac 1n)^n$ is increasing sequence by AM-GM inequality just like in section 2. and is bounded above since $(1-\frac 1n)^n < 1$ for all positive integers $n$. Therefore, $\lim_n(1-\frac 1n)^n$ exists and let's denote that limit as $L$.
To calculate $L$ let's do the following:
$$e\cdot L=\lim_n\left(1+\frac 1n\right)^n\cdot \lim_n\left(1-\frac 1n\right)^n = \lim_n\left(1-\frac 1{n^2}\right)^n = \lim_n\left(\left(1-\frac 1{n^2}\right)^{n^2}\right)^{\frac 1n} \stackrel{(*)}{=} 1$$ and therefore $L = e^{-1}$. This proves that $\lim_{x\to -\infty}\left(1+\frac 1x\right)^x =\lim_{x\to \infty}\left(1-\frac 1x\right)^{-x} = \frac 1{\lim_{x\to \infty}\left(1-\frac 1x\right)^{x}} = e.$
Let's elaborate on $(*)$. There is a lemma that states that if $a>0$ is constant, then $\lim_n\sqrt[n]a = 1$. This can be proven directly from binomial theorem and squeeze theorem without use of exponential function. Furthermore, since $(1-\frac 1{n^2})^{n^2}$ is increasing and bounded above by $1$, we have $$\left(1-\frac 1{2^2}\right)^{2^2} \leq \left(1-\frac 1{n^2}\right)^{n^2} \leq 1,\ n\geq 2$$ which implies $$\sqrt[n]{\left(1-\frac 1{2^2}\right)^{2^2}} \leq \sqrt[n]{\left(1-\frac 1{n^2}\right)^{n^2}} \leq \sqrt[n]{1},\ n\geq 2,$$ so taking the limit proves $(*)$ by squeeze theorem.
With this we are done, $\lim_{x\to 0^+}(1+x)^{\frac 1x} = \lim_{x\to 0^-}(1+x)^{\frac 1x} = e$, so $\lim_{x\to 0}(1+x)^{\frac 1x} = e$.