On page 269 in Dummit&Foote's Abstract Algebra, 3rd edition, it gives that every element in $\mathbb{Z}_p=\varprojlim\mathbb{Z}/p^i\mathbb{Z}$ can be written uniquely as an infinite formal sum $\sum^{\infty}_{k=0}b_kp^k$ with each $b_k\in[0,p-1]$ . But I was confused about how to define the addition and multiplication on $\sum^{\infty}_{k=0}b_kp^k$ such that it could keep the structure of rings. The following is my attempt: $$ \begin{cases} \displaystyle\left(\sum_{k=0}^{\infty}b_kp^k\right)+\left(\sum_{k=0}^{\infty}c_kp^k\right)=\sum_{k=0}^{\infty}\big(b_k+c_k\ \ (\mathrm{mod}\ \ p)\big)p^k \\\displaystyle\left(\sum_{k=0}^{\infty}b_kp^k\right)\cdot\left(\sum_{k=0}^{\infty}c_kp^k\right)=\sum_{k=0}^{\infty}\big(b_k\cdot c_k\ \ (\mathrm{mod}\ \ p)\big)p^k \end{cases} $$ where $\big(b_k+c_k\ \ (\mathrm{mod}\ \ p)\big)$ and $\big(b_k\cdot c_k\ \ (\mathrm{mod}\ \ p)\big)$ are in $[0,p-1]$ . But I am not sure that whether it is true.
Update on 2024.03.29: follow the hints from the comments I try to define new operations such that they hold for ordinary integers: $$ \begin{cases} \displaystyle\left(\sum_{k=0}^{\infty}b_kp^k\right)+\left(\sum_{k=0}^{\infty}c_kp^k\right)=\sum_{k=0}^{\infty}\big(b_k+c_k\big)p^k \\\displaystyle\left(\sum_{k=0}^{\infty}b_kp^k\right)\cdot\left(\sum_{k=0}^{\infty}c_kp^k\right)=\sum_{k=0}^{\infty}\left(\sum_{n=0}^kb_nc_{k-n}\right)p^k \end{cases} $$ More exactly, for the addition, we define the following maps: $$ \begin{cases} \pi_p:[0,2p-1]\to[0,p-1] \\\pi_p:d\mapsto\begin{cases}\begin{aligned}&d\ ,\hspace{-15pt}&d<p\\&d-p\ ,\hspace{-15pt}&d\geqslant p\end{aligned}\end{cases} \\\\\pi_2:[0,2p-2]\to[0,2-1] \\\pi_2:d\mapsto\begin{cases}\begin{aligned}&0\ ,\hspace{-15pt}&d<p\\&1\ ,\hspace{-15pt}&d\geqslant p\end{aligned}\end{cases} \end{cases} $$ if $\left(\sum_{k=0}^{\infty}b_kp^k\right)+\left(\sum_{k=0}^{\infty}c_kp^k\right)=\sum_{k=0}^{\infty}a_kp^k$ , then for $k\geqslant1$ , $$ a_k=\pi_p\big(b_k+c_k+\pi_2(b_{k-1}+c_{k-1})\big)\ , $$ such expression for $a_k$ keeps $a_k$ in the interval $[0,p-1]$ .
But for the multiplication I think it is a little harder to find a universal way to restrict the coefficient $a_k$ of $p^k$ for the product $\left(\sum_{k=0}^{\infty}b_kp^k\right)\cdot\left(\sum_{k=0}^{\infty}c_kp^k\right)=\sum_{k=0}^{\infty}a_kp^k$ to be in $[0,p-1]$ as desired.
Under such operations, it is easy to check that $1=1\cdot p^0+\sum_{k=1}^{\infty}0\cdot p^k$ and $0=\sum_{k=0}^{\infty}0\cdot p^k$ is the multiplicative identity and the zero element of $\mathbb{Z}_p$ resp.
It would not be easy to produce simple formulas. Roughly speaking, the connection between arithmetic and bitwise operations is complicated as seen from computer science. Had there been, math education in elementary school can be significantly simplified, since the formula must be able to re-produce the results for natural numbers. However, there is a very concrete way to understand and perform the operations.
Given two positive integers $a=\sum_{i=0}^n a_i l^i$ and $b=\sum_{i=0}^n b_i l^i$ written in $l$-adic manner where $l$ doesn't even have to be a prime. By the same way we perform addition and multiplication for $l=10$ in real life and scientific investigations, we can perform the operation for general $l$.
Here is the key insight: There is nothing that stopped us from defining $a=\sum_{i=0}^\infty a_i l^i$ and $b=\sum_{i=0}^\infty b_i l^i$ formally (i.e. as two infinite sequences $(a_1, a_2, \cdots)$ and $(b_1, b_2, \cdots)$), and their additions and multiplications as above. It's just that you may never finish the calculation but you can always produce the next symbol if requested. In particular, if we stopped at $i=n$, then we are essentially dropping everything that is a multiple of $l^n$, hence the calculation is really performed as in $\mathbb Z/l^n\mathbb Z$.
For example, in the case of $l=2$, we can define the sum of $a=\sum_{i=0}^\infty 2^n = 111111\cdots$ (well we usually write $\cdots 11111$ when the string is finite with least significant bit at tail, but this is not important) and $b=1$, note that $1+1$ is $0$ with $1$ as the carry, hence by performing the usual arithmetic in base $2$ indefinitely, we can show $a+b=0000\cdots$, that is $a=-1$ in the ring. This explains why in the two's complement represetation, $-1$ is always full of $1$'s, no matter how many bits are allowed, because $111\cdots1$ is an approximation of $-1$ (and precisely $-1$ if infinitely extended).
Then why $l$ has to be a prime? It doesn't have to be. That is you can always define the ring $\varprojlim \mathbb Z/l^n\mathbb Z$ as above, a concrete hands-on approach without abstract algebra, but only when $l$ is a prime power, this ring is an integral domain.