This paper studies a single-user wireless powered mobile edge computing (MEC) system, in which one multi-antenna energy transmitter (ET) employs energy beamforming for wireless power transfer (WPT) towards the user, and the user relies on the harvested energy to locally execute a portion of tasks and offload the other portion to an access point (AP) integrated with an MEC server for remote execution. Different from prior works considering static wireless channels and computation tasks at the user, this paper considers a scenario with fluctuating channels and dynamic task arrivals over time. As such, both energy and task causality constraints are introduced at the user node, thus imposing new challenges in the system design. In particular, we jointly optimize the transmission energy allocation at the ET for WPT and the task allocation at the user for local computing and offloading over a particular finite horizon, with the objective of minimizing the total transmission energy consumption at the ET while ensuring the user's successful task execution. First, to characterize the fundamental performance limit, we consider the offline optimization by assuming that the perfect knowledge of channel state information (CSI) and task state information (TSI) (i.e., task arrival timing and amounts) is known apriori. In this case, we obtain the well-structured optimal solution to the energy minimization problem by using convex optimization techniques. The optimal solution shows that in the scenario with static channels, the ET should allocate the transmission energy uniformly over time, and the user should employ staircase task allocation for both local computing and offloading, with the number of executed task input-bits monotonically increasing over time. It also shows that in the scenario with time-varying channels, the ET should transmit energy sporadically at slots with causally dominating channel power